Commit 6cfee3c6 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1508204: Can remove tagged blog options in modal



Stops the modal from being closed when clicking on the 'x' on the tag
options.

behatnotneeded: will add behat test is subpatch as there needs to be a
new step added

Change-Id: I8c1589fb708e654ca3200e1893ed25def19a5a3d
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 199f94d3
......@@ -392,6 +392,32 @@ EOF;
}
public static function get_instance_config_javascript(BlockInstance $instance) {
return <<<EOF
jQuery(function($) {
$('#instconf_tagselect').on('change', function() {
updatetagbuttons();
});
updatetagbuttons();
function updatetagbuttons() {
$('#instconf_tagselect_container ul button').on('click', function(e) {
e.stopPropagation();
e.preventDefault();
var li = $(this).parent();
var val = $('#instconf_tagselect').select2('val');
var index = val.indexOf(li[0].title);
if (index > -1) {
val.splice(index, 1);
}
$('#instconf_tagselect').select2('val', val);
});
}
});
EOF;
}
public static function instance_config_validate($form, $values) {
if (empty($values['tagselect'])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment