Roo/bootstrap/Popover.js
authorAlan Knowles <alan@roojs.com>
Wed, 27 Jan 2021 09:48:18 +0000 (17:48 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 27 Jan 2021 09:48:18 +0000 (17:48 +0800)
Roo/bootstrap/Popover.js

index 73aaee8..b2c2050 100644 (file)
@@ -288,11 +288,43 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
     
 });
 
-Roo.bootstrap.Popover.alignment = {
-    'left' : ['r-l', [-10,0], 'right bs-popover-right'],
-    'right' : ['l-r', [10,0], 'left bs-popover-left'],
-    'bottom' : ['t-b', [0,10], 'top bs-popover-top'],
-    'top' : [ 'b-t', [0,-10], 'bottom bs-popover-bottom']
-};
+
+Roo.apply(Roo.bootstrap.Popover, {
+
+    alignment : {
+        'left' : ['r-l', [-10,0], 'right bs-popover-right'],
+        'right' : ['l-r', [10,0], 'left bs-popover-left'],
+        'bottom' : ['t-b', [0,10], 'top bs-popover-top'],
+        'top' : [ 'b-t', [0,-10], 'bottom bs-popover-bottom']
+    },
+
+    clickHander : false,
+    
+
+    onMouseDown : function(e)
+    {
+        if (!e.getTarget(".roo-popup")) {
+            
+        }
+        
+        this.popups.each(function(p) {
+            p.hide()); })
+        
+    },
+    
+    popups : [],
+    
+    register : function(popup)
+    {
+        // hide other popups.
+        this.popups.each(function(p) { p.hide()); })
+        this.popups.push(popup);
+    },
+    hideAll : function()
+    {
+        this.popups.each(function(p) {
+            p.hide());
+        })
+    }
 
  
\ No newline at end of file