summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/tag/script.js
blob: ffa1d45ba1ee7211e1b329666652e12262b52a53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
            }
        }
    })
});