diff options
author | Joseph Mitchell Magen <jmagen@redhat.com> | 2013-01-03 15:39:55 +0200 |
---|---|---|
committer | Joseph Mitchell Magen <jmagen@redhat.com> | 2013-01-03 15:39:55 +0200 |
commit | 1db747ea375404bff0e10d2a6a55c2048efd4052 (patch) | |
tree | 0e30d62a3abd51f41c3e1325e0771ddbaa6c8a44 | |
parent | 788d3b118235e4f756c3d05c125283b264b9bd31 (diff) | |
download | multi-select-1db747ea375404bff0e10d2a6a55c2048efd4052.zip multi-select-1db747ea375404bff0e10d2a6a55c2048efd4052.tar.gz multi-select-1db747ea375404bff0e10d2a6a55c2048efd4052.tar.bz2 |
disable selectedLi if selected, not selectableLi
-rw-r--r-- | js/jquery.multi-select.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index 0ceb993..d694cf4 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -121,8 +121,13 @@ that.$selectionUl.find('.ms-optgroup-label').hide(); if ($(this).prop('disabled') || ms.prop('disabled')){ - selectableLi.prop('disabled', true); - selectableLi.addClass(that.options.disabledClass); + if (this.selected) { + selectedLi.prop('disabled', true); + selectedLi.addClass(that.options.disabledClass); + } else { + selectableLi.prop('disabled', true); + selectableLi.addClass(that.options.disabledClass); + } } if (optgroupId){ @@ -266,7 +271,7 @@ } else { that.$selectableUl.focusin(); that.$selectionUl.focusout(); - } + } } } @@ -421,7 +426,7 @@ $.fn.multiSelect = function () { var option = arguments[0], args = arguments; - + return this.each(function () { var $this = $(this), data = $this.data('multiselect'), |