Skip to content

Commit fd3135c

Browse files
committed
Fix #457
Allowing the user to update the header after initialization.
1 parent 8e0b7f5 commit fd3135c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jquery.multiselect.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,12 @@
850850

851851
switch(key) {
852852
case 'header':
853-
menu.find('div.ui-multiselect-header')[value ? 'show' : 'hide']();
853+
if(typeof value === 'boolean') {
854+
this.header[value ? 'show' : 'hide']();
855+
} else if(typeof value === 'string') {
856+
this.headerLinkContainer.children("li:not(:last-child)").remove();
857+
this.headerLinkContainer.prepend("<li>" + value + "</li>");
858+
}
854859
break;
855860
case 'checkAllText':
856861
menu.find('a.ui-multiselect-all span').eq(-1).text(value);

0 commit comments

Comments
 (0)