浏览代码

a small optimization to how many times highlight is called

Igor Vaynberg 13 年之前
父节点
当前提交
1e2881d5d1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -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));
             }