Commit 8d803bd2 authored by David Stutz's avatar David Stutz

Merge pull request #275 from Tyf0x/master

Select-All performance improvement.
parents 47d60e38 74e24a50
...@@ -345,25 +345,19 @@ ...@@ -345,25 +345,19 @@
var $checkboxesNotThis = $('input', this.$container).not($target); var $checkboxesNotThis = $('input', this.$container).not($target);
if (isSelectAllOption) { if (isSelectAllOption) {
if (this.$select[0][0].value === this.options.selectAllValue) { var values = [];
// Select the visible checkboxes except the "select-all" and possible divider.
var values = []; var availableInputs = $('li input[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$ul).filter(':visible');
var options = $('option[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$select);
for (var i = 0, j = availableInputs.length; i < j; i++) {
for (var i = 0; i < options.length; i++) { values.push(availableInputs[i].value);
}
// Check whether this option is actually visible.
if (this.getInputByValue(options[i].value) && this.getInputByValue(options[i].value).is(':visible')) {
values.push(options[i].value);
}
}
if (checked) { if (checked) {
this.select(values); this.select(values);
} }
else { else {
this.deselect(values); this.deselect(values);
}
} }
} }
......
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