From e0f854d6678ba765cee4168e55f892980f8799a8 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 27 Apr 2012 22:39:40 -0700 Subject: [PATCH] copy the args object so changes to it no longer effect other select2s. closes #47 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 70bf0675..8df20e90 100755 --- a/select2.js +++ b/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") {