1/**
2 * @author Laurent Forthomme <lforthomme@protonmail.com>
3 */
4
5jQuery('select.plugin__schulzevote__vote_selector').change(function(){
6    // start by setting everything to enabled
7    jQuery(this).children('option').each(function() {
8        jQuery(this).attr('disabled', false);
9    });
10    // loop each select and set the selected value to disabled in all other selects
11    jQuery('select.plugin__schulzevote__vote_selector').each(function(){
12        var $this = jQuery(this);
13        jQuery('select.plugin__schulzevote__vote_selector').not($this).find('option').each(function(){
14            if(jQuery(this).attr('value') == $this.val() && jQuery(this).attr('value') !== '-')
15                jQuery(this).attr('disabled',true);
16        });
17    });
18});
19