fix popover issue
[roojs1] / Roo / bootstrap / Popover.js
index f984d2b..031926d 100644 (file)
@@ -287,14 +287,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             this.render(document.body);
         }
         
-        var x = this.alignEl.dom;
-        while (x && "auto" ==getComputedStyle(x).zIndex) {
-            //Roo.log(getComputedStyle(x).zIndex );
-            x = x.parentNode;
-        }
-        if (x) {
-            this.el.dom.style.zIndex = (1*getComputedStyle(x).zIndex) + 1000;
-        }
+        
          
         
         if (this.title === false) {
@@ -451,15 +444,18 @@ Roo.apply(Roo.bootstrap.Popover, {
 
     clickHander : false,
     
+    
 
     onMouseDown : function(e)
     {
-        if (!e.getTarget(".roo-popover")) {
+        if (this.popups.length &&  !e.getTarget(".roo-popover")) {
+            /// what is nothing is showing..
             this.hideAll();
         }
          
     },
     
+    
     popups : [],
     
     register : function(popup)
@@ -468,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