Commit 7d6811d6 authored by David Stutz's avatar David Stutz

Some fixes for #628.

parent 2ba8085c
......@@ -170,7 +170,7 @@
this.buildFilter();
this.updateButtonText();
this.updateSelectAll();
this.updateSelectAll(true);
if (this.options.disableIfEmpty && $('option', this.$select).length <= 0) {
this.disable();
......@@ -1212,7 +1212,7 @@
this.buildFilter();
this.updateButtonText();
this.updateSelectAll();
this.updateSelectAll(true);
if (this.options.disableIfEmpty && $('option', this.$select).length <= 0) {
this.disable();
......@@ -1322,7 +1322,7 @@
/**
* Updates the select all checkbox based on the currently displayed and selected checkboxes.
*/
updateSelectAll: function() {
updateSelectAll: function(notTriggerOnSelectAll) {
if (this.hasSelectAll()) {
var allBoxes = $("li:not(.multiselect-item):not(.filter-hidden) input:enabled", this.$ul);
var allBoxesLength = allBoxes.length;
......@@ -1339,7 +1339,9 @@
selectAllInput.prop("checked", false);
selectAllLi.removeClass(this.options.selectedClass);
if (checkedBoxesLength === 0) {
this.options.onSelectAll(false);
if (!notTriggerOnSelectAll) {
this.options.onSelectAll(false);
}
}
}
}
......
......@@ -2059,8 +2059,8 @@
$(document).ready(function() {
$('#example-onSelectAll').multiselect({
includeSelectAllOption: true,
onSelectAll: function() {
alert('onSelectAll triggered.');
onSelectAll: function(checked) {
alert('onSelectAll triggered: ' + (checked ? 'selected all' : 'deselected all') + '!');
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment