Skip to content

Commit 8e0b7f5

Browse files
committed
Fix #502
Bring the check all and uncheck all buttons back when the widget is initialized as a single select and switches to a multi. Uncheck all the options when changing modes, it doesn't make sense to keep them when changing.
1 parent e43a12c commit 8e0b7f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jquery.multiselect.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
}
144144
if(!this.options.multiple) {
145145
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide();
146+
} else {
147+
this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').show();
146148
}
147149
if(this.options.autoOpen) {
148150
this.open();
@@ -879,6 +881,7 @@
879881
menu.toggleClass('ui-multiselect-single', !value);
880882
this.options.multiple = value;
881883
this.element[0].multiple = value;
884+
this.uncheckAll();
882885
this.refresh();
883886
break;
884887
case 'position':

0 commit comments

Comments
 (0)