Skip to content

Commit d412b35

Browse files
committed
Now the it can be set to show only one of "CheckAll" or "UncheckAll" if needed
1 parent 9811e95 commit d412b35

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/jquery.multiselect.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
checkAllText: 'Check all',
3535
uncheckAllText: 'Uncheck all',
3636
noneSelectedText: 'Select options',
37+
showCheckAll: true,
38+
showUncheckAll: true,
3739
selectedText: '# selected',
3840
selectedList: 0,
3941
closeIcon: 'ui-icon-circle-close',
@@ -83,7 +85,12 @@
8385
.addClass('ui-helper-reset')
8486
.html(function() {
8587
if(o.header === true) {
86-
return '<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>' + o.checkAllText + '</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>' + o.uncheckAllText + '</span></a></li>';
88+
var header_lis = '';
89+
if(o.showCheckAll)
90+
header_lis = '<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>' + o.checkAllText + '</span></a></li>';
91+
if(o.showUncheckAll)
92+
header_lis += '<li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>' + o.uncheckAllText + '</span></a></li>';
93+
return header_lis;
8794
} else if(typeof o.header === "string") {
8895
return '<li>' + o.header + '</li>';
8996
} else {

0 commit comments

Comments
 (0)