diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/jquery.multi-select.1.6.js | 6 | ||||
-rw-r--r-- | js/jquery.multi-select.js | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/js/jquery.multi-select.1.6.js b/js/jquery.multi-select.1.6.js index 917f13a..95360d6 100644 --- a/js/jquery.multi-select.1.6.js +++ b/js/jquery.multi-select.1.6.js @@ -1,5 +1,7 @@ (function($){ var msMethods = { + + 'init' : function(options){ this.settings = { disabledClass : 'disabled' @@ -14,7 +16,7 @@ multiSelects.each(function(){ var ms = $(this); ms.val(null); - ms.attr('id', ms.attr('id') != undefined ? ms.attr('id') : 'ms-'+Math.ceil(Math.random()*1000)); + ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)); var container = $('<div id="ms-'+ms.attr('id')+'" class="ms-container"></div>'), selectableContainer = $('<div class="ms-selectable"></div>'), selectedContainer = $('<div class="ms-selection"></div>'), @@ -69,7 +71,7 @@ selectedUl = $('#ms-'+ms.attr('id')+' .ms-selection ul'), selectableLi = selectableUl.children('li[ms-value="'+value+'"]'); - if (selectableLi.prop('disabled') == undefined){ + if (!selectableLi.prop('disabled')){ selectableLi.hide(); ms.val(newValues); if(titleAttr){ diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index b83f285..d157401 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -14,7 +14,7 @@ multiSelects.each(function(){ var ms = $(this); ms.val(null); - ms.attr('id', ms.attr('id') != undefined ? ms.attr('id') : 'ms-'+Math.ceil(Math.random()*1000)); + ms.attr('id', ms.attr('id') ? ms.attr('id') : 'ms-'+Math.ceil(Math.random()*1000)); var container = $('<div id="ms-'+ms.attr('id')+'" class="ms-container"></div>'), selectableContainer = $('<div class="ms-selectable"></div>'), selectedContainer = $('<div class="ms-selection"></div>'), @@ -69,7 +69,7 @@ selectedUl = $('#ms-'+ms.attr('id')+' .ms-selection ul'), selectableLi = selectableUl.children('li[ms-value="'+value+'"]'); - if (selectableLi.attr('disabled') == undefined){ + if (!selectableLi.attr('disabled')){ selectableLi.hide(); ms.val(newValues); if(titleAttr){ |