a small optimization to how many times highlight is called
This commit is contained in:
parent
b2314bcb86
commit
1e2881d5d1
@ -785,7 +785,7 @@
|
|||||||
|
|
||||||
highlightUnderEvent: function (event) {
|
highlightUnderEvent: function (event) {
|
||||||
var el = $(event.target).closest(".select2-result");
|
var el = $(event.target).closest(".select2-result");
|
||||||
if (el.length > 0) {
|
if (el.length > 0 && !el.is(".select2-highlighted")) {
|
||||||
var choices = this.results.find('.select2-result');
|
var choices = this.results.find('.select2-result');
|
||||||
this.highlight(choices.index(el));
|
this.highlight(choices.index(el));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user