Skip to content

Commit a8cf24d

Browse files
authored
Merge pull request #825 from Mazenrab/fix-toggleDisabled
fix _toggleDisabled error this.$button is undefined when listbox option is set to true
2 parents 078afcb + 5a2b5e1 commit a8cf24d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jquery.multiselect.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,8 +1353,10 @@
13531353
_toggleDisabled: function(flag, groupID) {
13541354
var disabledClass = 'ui-state-disabled'; // used for styling only
13551355

1356-
this.$button.prop({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ](disabledClass);
1357-
1356+
if (this.$button) {
1357+
this.$button.prop({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ](disabledClass);
1358+
}
1359+
13581360
if (this.options.disableInputsOnToggle) {
13591361
// Apply the ui-multiselect-disabled class name to identify which
13601362
// input elements this widget disabled (not pre-disabled)

0 commit comments

Comments
 (0)