1
0
mirror of synced 2025-03-10 22:56:12 +03:00

a small optimization to how many times highlight is called

This commit is contained in:
Igor Vaynberg 2012-06-18 20:44:26 -07:00
parent b2314bcb86
commit 1e2881d5d1

View File

@ -785,7 +785,7 @@
highlightUnderEvent: function (event) {
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');
this.highlight(choices.index(el));
}