소스 검색

Fix issue syncing CSS classes in IE9/10

jorupp 11 년 전
부모
커밋
632595f530
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      select2.js

+ 7 - 3
select2.js

@@ -1079,9 +1079,13 @@ the specific language governing permissions and limitations under the Apache Lic
 
             });
 
-            // IE8-10
-            el.on("propertychange.select2", sync);
-
+            // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
+            if (el.length && el[0].attachEvent) {
+                el.each(function() {
+                    this.attachEvent("onpropertychange", sync);
+                });
+            }
+            
             // hold onto a reference of the callback to work around a chromium bug
             if (this.mutationCallback === undefined) {
                 this.mutationCallback = function (mutations) {