Pārlūkot izejas kodu

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

Igor Vaynberg 13 gadi atpakaļ
vecāks
revīzija
e0f854d667
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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") {