svg changes
[roojs1] / Roo / bootstrap / Popover.js
index bcdc781..376b2d3 100644 (file)
@@ -444,15 +444,18 @@ Roo.apply(Roo.bootstrap.Popover, {
 
     clickHander : false,
     
+    
 
     onMouseDown : function(e)
     {
-        if (!e.getTarget(".roo-popover")) {
+        if (this.popup.length &&  !e.getTarget(".roo-popover") && this.popup.length) {
+            /// what is nothing is showing..
             this.hideAll();
         }
          
     },
     
+    
     popups : [],
     
     register : function(popup)
@@ -461,14 +464,22 @@ Roo.apply(Roo.bootstrap.Popover, {
             Roo.bootstrap.Popover.clickHandler = Roo.get(document).on("mousedown", Roo.bootstrap.Popover.onMouseDown, Roo.bootstrap.Popover);
         }
         // hide other popups.
-        this.hideAll();
-        this.popups.push(popup);
+        popup.on('show', Roo.bootstrap.Popover.onShow,  popup);
+        popup.on('hide', Roo.bootstrap.Popover.onHide,  popup);
+        this.hideAll(); //<< why?
+        //this.popups.push(popup);
     },
     hideAll : function()
     {
         this.popups.forEach(function(p) {
             p.hide();
         });
-    }
+    },
+    onShow : function() {
+        Roo.bootstrap.Popover.popups.push(this);
+    },
+    onHide : function() {
+        Roo.bootstrap.Popover.popups.remove(this);
+    },
 
 });
\ No newline at end of file