Skip to content

Commit ff0ce54

Browse files
author
Michael
committed
Fix #681
Check specific class names in bindHeaderEvents for checkAll, unCheckAll and close rather than using a blanket else statement. This lets users define additional custom header buttons if they want.
1 parent a9fcf40 commit ff0ce54

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/jquery.multiselect.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,14 @@
464464
var self = this;
465465
// header links
466466
this.header.delegate('a', 'click.multiselect', function(e) {
467-
// close link
468-
if($(this).hasClass('ui-multiselect-close')) {
467+
var $this = $(this);
468+
if($this.hasClass('ui-multiselect-close')) {
469469
self.close();
470-
471-
// check all / uncheck all
472-
} else {
473-
self[$(this).hasClass('ui-multiselect-all') ? 'checkAll' : 'uncheckAll']();
470+
} else if($this.hasClass("ui-multiselect-all")) {
471+
self.checkAll();
472+
} else if($this.hasClass("ui-multiselect-none")) {
473+
self.uncheckAll();
474474
}
475-
476475
e.preventDefault();
477476
}).delegate('a', 'keydown.multiselect', function(e) {
478477
switch(e.which) {

0 commit comments

Comments
 (0)