]> source.dussan.org Git - sonarqube.git/commitdiff
fix select2 closing problem in the facet sidebar
authorStas Vilchik <vilchiks@gmail.com>
Tue, 20 Oct 2015 07:40:01 +0000 (09:40 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 20 Oct 2015 07:40:01 +0000 (09:40 +0200)
server/sonar-web/src/main/js/libs/third-party/select2.js

index 213f4cf930af6caa1745f2418d5d23342ff3403e..8975c0ea4c275e2733e51312ca8a05371e697c00 100644 (file)
             var cid = this.containerId, selector = this.containerSelector,
                 scroll = "scroll." + cid, resize = "resize." + cid;
 
-            this.container.parents().each(function() {
-                $(this).bind(scroll, function() {
-                    var s2 = $(selector);
-                    if (s2.length == 0) {
-                        $(this).unbind(scroll);
-                    }
-                    s2.select2("close");
+            setTimeout(function () {
+                this.container.parents().each(function() {
+                    $(this).bind(scroll, function() {
+                        var s2 = $(selector);
+                        if (s2.length == 0) {
+                            $(this).unbind(scroll);
+                        }
+                        s2.select2("close");
+                    });
                 });
-            });
+            }.bind(this), 100);
 
             $(window).bind(resize, function() {
                 var s2 = $(selector);
         // single
         close: function () {
             if (!this.opened()) return;
+            console.log('closing...');
             this.parent.close.apply(this, arguments);
             this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show();
         },