소스 검색

copy the args object so changes to it no longer effect other select2s. closes #47

Igor Vaynberg 13 년 전
부모
커밋
e0f854d667
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -1417,7 +1417,7 @@
 
         this.each(function () {
             if (args.length === 0 || typeof(args[0]) === "object") {
-                opts = args.length === 0 ? {} : args[0];
+                opts = args.length === 0 ? {} : $.extend({}, args[0]);
                 opts.element = $(this);
 
                 if (opts.element.get(0).tagName.toLowerCase() === "select") {