From a3383141d5d420b83df5461542d7554d11dd07a7 Mon Sep 17 00:00:00 2001 From: Ali Malrkpour Date: Sun, 15 Jul 2012 23:20:56 -0400 Subject: [PATCH] fix body element caching for non attached elements --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index ee36ce04..f8ac67a3 100755 --- a/select2.js +++ b/select2.js @@ -429,7 +429,7 @@ this.enabled=true; this.container = this.createContainer(); - this.body = opts.element.closest("body"); // cache for future access + this.body = $("body"); // opts.element.closest("body"); // cache for future access if (opts.element.attr("class") !== undefined) { this.container.addClass(opts.element.attr("class"));