Commit 6d779b2f authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Bug 1508204: Can remove tagged blog options in modal"

parents c221323f 6cfee3c6
......@@ -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