diff options
Diffstat (limited to 'platform/www/lib/plugins/tag/script.js')
-rw-r--r-- | platform/www/lib/plugins/tag/script.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/tag/script.js b/platform/www/lib/plugins/tag/script.js new file mode 100644 index 0000000..ffa1d45 --- /dev/null +++ b/platform/www/lib/plugins/tag/script.js @@ -0,0 +1,16 @@ +/** + * For the searchtags syntax: make the checkboxes behave like radio buttons + * so the user can't both include and exclude a tag + */ +jQuery(function() { + jQuery('form.plugin__tag_search table input').change(function() { + if (jQuery(this).attr('checked')) { // was this input checked? + if (jQuery(this).parent().hasClass('minus')) { + // find the other input in the same tr and uncheck it + jQuery(this).closest('tr').find('.plus input').attr('checked', false); + } else { + jQuery(this).closest('tr').find('.minus input').attr('checked', false); + } + } + }) +}); |