Commit 50374b12 authored by David Stutz's avatar David Stutz

Merge pull request #192 from itsNikolay/select-all_improvement

Performance for select-all.
parents ea8416e4 ee5b93ff
......@@ -238,10 +238,17 @@
// Toggle all options if the select all option was changed.
if (isSelectAllOption) {
$checkboxesNotThis.filter(function() {
return $(this).is(':checked') != checked;
}).trigger('click');
}
if (this.$select[0][0].value == this.options.selectAllValue) {
var values = [];
var options = this.$select.children();
for(var i = 0; i < $checkboxesNotThis.length; i++) {
if (options[i].value !== this.options.selectAllValue) {
values.push(options[i].value);
}
}
checked ? this.select(values) : this.deselect(values)
}
}
if (checked) {
$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