Commit 74e24a50 authored by geonewlitho's avatar geonewlitho

** Select-All performance improvement **

-> Drastic performance improvement to the "Select All" button
parent 75501599
...@@ -343,17 +343,12 @@ ...@@ -343,17 +343,12 @@
var $checkboxesNotThis = $('input', this.$container).not($(event.target)); var $checkboxesNotThis = $('input', this.$container).not($(event.target));
if (isSelectAllOption) { if (isSelectAllOption) {
if (this.$select[0][0].value === this.options.selectAllValue) {
var values = []; var values = [];
var options = $('option[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$select); // Select the visible checkboxes except the "select-all" and possible divider.
var availableInputs = $('li input[value!="' + this.options.selectAllValue + '"][data-role!="divider"]', this.$ul).filter(':visible');
for (var i = 0; i < options.length; i++) {
// Check whether this option is actually visible. for (var i = 0, j = availableInputs.length; i < j; i++) {
if (this.getInputByValue(options[i].value) && this.getInputByValue(options[i].value).is(':visible')) { values.push(availableInputs[i].value);
values.push(options[i].value);
}
} }
if (checked) { if (checked) {
...@@ -363,7 +358,6 @@ ...@@ -363,7 +358,6 @@
this.deselect(values); this.deselect(values);
} }
} }
}
if (checked) { if (checked) {
$option.prop('selected', true); $option.prop('selected', true);
......
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