summaryrefslogtreecommitdiffstats
path: root/js/jquery.multi-select.js
diff options
context:
space:
mode:
authorlouis cuny <louiscuny@gmail.com>2014-01-28 05:37:56 -0800
committerlouis cuny <louiscuny@gmail.com>2014-01-28 05:37:56 -0800
commit65f9282a981fd4be371ee83580298c071a862c70 (patch)
treee1cd5cbfd0a7b5e517d84d71d63b5e2ee98cd877 /js/jquery.multi-select.js
parent74166e9829c3467c7aa18d8b2b8cf57394a5f97f (diff)
parent0d9c9dc565c1727c4cbf666dc3b3ed12bb0768fb (diff)
downloadmulti-select-65f9282a981fd4be371ee83580298c071a862c70.zip
multi-select-65f9282a981fd4be371ee83580298c071a862c70.tar.gz
multi-select-65f9282a981fd4be371ee83580298c071a862c70.tar.bz2
Merge pull request #114 from sterrien/master
Allow selected and disabled options
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r--js/jquery.multi-select.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index 297a7c5..b705a27 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -349,6 +349,11 @@
selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
+ if (method === 'init'){
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
+ }
+
if (selectables.length > 0){
selectables.addClass('ms-selected').hide();
selections.addClass('ms-selected').show();
@@ -394,7 +399,7 @@
ms = this.$element,
msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
- selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected'),
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
if (selections.length > 0){