diff options
author | louis cuny <louiscuny@gmail.com> | 2016-11-22 12:16:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-22 12:16:47 +0100 |
commit | bc93593cfea2bf40cc26cc6680c740d982ecf816 (patch) | |
tree | 267615d8129f2931ebb0db270ad0ec88b5e9e465 /js/jquery.multi-select.js | |
parent | 7a5354c2bcec3832c688bf8ee175b650c46a4ab9 (diff) | |
parent | 548e666ea5c7c7e763a19c6ad90712b6ae113f57 (diff) | |
download | multi-select-bc93593cfea2bf40cc26cc6680c740d982ecf816.zip multi-select-bc93593cfea2bf40cc26cc6680c740d982ecf816.tar.gz multi-select-bc93593cfea2bf40cc26cc6680c740d982ecf816.tar.bz2 |
Merge pull request #255 from Westwing-Home-and-Living/master
Add `optionClass` and `disabled` options to addOption method
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r-- | js/jquery.multi-select.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js index fb478f5..653aa07 100644 --- a/js/jquery.multi-select.js +++ b/js/jquery.multi-select.js @@ -184,6 +184,14 @@ index = parseInt((typeof option.index === 'undefined' ? that.$element.children().length : option.index)), $container = option.nested === undefined ? that.$element : $("optgroup[label='"+option.nested+"']"); + if (option.optionClass) { + $option.addClass(option.optionClass); + } + + if (option.disabled) { + $option.prop('disabled', true); + } + $option.insertAt(index, $container); that.generateLisFromOption($option.get(0), index, option.nested); } |