summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Aba <peter.aba@westwing.de>2016-11-22 11:12:47 +0100
committerPeter Aba <peter.aba@westwing.de>2016-11-22 11:12:47 +0100
commit548e666ea5c7c7e763a19c6ad90712b6ae113f57 (patch)
tree267615d8129f2931ebb0db270ad0ec88b5e9e465
parent7a5354c2bcec3832c688bf8ee175b650c46a4ab9 (diff)
downloadmulti-select-548e666ea5c7c7e763a19c6ad90712b6ae113f57.zip
multi-select-548e666ea5c7c7e763a19c6ad90712b6ae113f57.tar.gz
multi-select-548e666ea5c7c7e763a19c6ad90712b6ae113f57.tar.bz2
Add optionClass and disabled options to addOption
-rw-r--r--js/jquery.multi-select.js8
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);
}