소스 검색

Fix broken tags, #3695

The local variable defined will overwrite the tags function, since the var will get hoisted to the functional scope
Tom Zellman 10 년 전
부모
커밋
3be19d8e62
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      select2.js

+ 4 - 4
select2.js

@@ -1023,14 +1023,14 @@ the specific language governing permissions and limitations under the Apache Lic
 
             // data-select2-tags -> data-tags
             if (opts.element.data('tags') != null) {
-                var tags = opts.element.data('tags');
+                var elemTags = opts.element.data('tags');
 
                 // data-tags should actually be a boolean
-                if (!$.isArray(tags)) {
-                    tags = [];
+                if (!$.isArray(elemTags)) {
+                    elemTags = [];
                 }
 
-                opts.element.data('select2Tags', tags);
+                opts.element.data('select2Tags', elemTags);
             }
 
             // sortResults -> sorter