From 3f43f459e9c0f8d126b64437e41704ffa54fcb2b Mon Sep 17 00:00:00 2001 From: Eduardo Matos Date: Fri, 11 Apr 2014 14:02:11 -0300 Subject: [PATCH 1/2] Testing if the dropdown is opened before call positionDropdown, on events by resize, scroll and orientation --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 91892eee..9a927dc4 100644 --- a/select2.js +++ b/select2.js @@ -1390,7 +1390,7 @@ the specific language governing permissions and limitations under the Apache Lic var that = this; this.container.parents().add(window).each(function () { $(this).on(resize+" "+scroll+" "+orient, function (e) { - that.positionDropdown(); + if (!that.opened()) that.positionDropdown(); }); }); From 22d503f8461ce5d47776f7676c833a0adf4c0de1 Mon Sep 17 00:00:00 2001 From: Eduardo Matos Date: Tue, 15 Apr 2014 10:51:23 -0300 Subject: [PATCH 2/2] Avoid call 'positionDropdown' function if the container it's closed --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 9a927dc4..e6406950 100644 --- a/select2.js +++ b/select2.js @@ -1390,7 +1390,7 @@ the specific language governing permissions and limitations under the Apache Lic var that = this; this.container.parents().add(window).each(function () { $(this).on(resize+" "+scroll+" "+orient, function (e) { - if (!that.opened()) that.positionDropdown(); + if (that.opened()) that.positionDropdown(); }); });