소스 검색

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