fix popover issue
authorAlan Knowles <alan@roojs.com>
Mon, 5 Jul 2021 05:04:11 +0000 (13:04 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 5 Jul 2021 05:04:11 +0000 (13:04 +0800)
Roo/bootstrap/Popover.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 604aad6..031926d 100644 (file)
@@ -480,6 +480,6 @@ Roo.apply(Roo.bootstrap.Popover, {
     },
     onHide : function() {
         Roo.bootstrap.Popover.popups.remove(this);
     },
     onHide : function() {
         Roo.bootstrap.Popover.popups.remove(this);
-    },
+    } 
 
 });
\ No newline at end of file
 
 });
\ No newline at end of file
index f88b100..9e4fb24 100644 (file)
@@ -20403,7 +20403,7 @@ Roo.apply(Roo.bootstrap.Popover, {
 
     onMouseDown : function(e)
     {
 
     onMouseDown : function(e)
     {
-        if (this.popup.length &&  !e.getTarget(".roo-popover") && this.popup.length) {
+        if (this.popups.length &&  !e.getTarget(".roo-popover")) {
             /// what is nothing is showing..
             this.hideAll();
         }
             /// what is nothing is showing..
             this.hideAll();
         }
@@ -20419,10 +20419,10 @@ Roo.apply(Roo.bootstrap.Popover, {
             Roo.bootstrap.Popover.clickHandler = Roo.get(document).on("mousedown", Roo.bootstrap.Popover.onMouseDown, Roo.bootstrap.Popover);
         }
         // hide other popups.
             Roo.bootstrap.Popover.clickHandler = Roo.get(document).on("mousedown", Roo.bootstrap.Popover.onMouseDown, Roo.bootstrap.Popover);
         }
         // hide other popups.
-        popup.on('show', Roo.bootstrap.Popover.onShow, Roo.bootstrap.Popover, popup);
-        popup.on('hide', Roo.bootstrap.Popover.onHide, Roo.bootstrap.Popover, popup);
-        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()
     {
     },
     hideAll : function()
     {
@@ -20430,9 +20430,12 @@ Roo.apply(Roo.bootstrap.Popover, {
             p.hide();
         });
     },
             p.hide();
         });
     },
-    onShow : function(p) {
-        this.popups.push(p);
-    }
+    onShow : function() {
+        Roo.bootstrap.Popover.popups.push(this);
+    },
+    onHide : function() {
+        Roo.bootstrap.Popover.popups.remove(this);
+    } 
 
 });/*
  * - LGPL
 
 });/*
  * - LGPL
index 24e2f4a..ee6d637 100644 (file)
@@ -841,8 +841,8 @@ var xy=this.alignEl.getAnchorXY('tl',false);xy[0]-=10;xy[1]+=5;this.arrowEl.setX
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('t',false);xy[1]-=10;this.arrowEl.setXY(xy);return true;}return this.updatePosition('bottom',false);case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,10]);var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,10]);
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('b',false);xy[1]+=2;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
 this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('t',false);xy[1]-=10;this.arrowEl.setXY(xy);return true;}return this.updatePosition('bottom',false);case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,10]);var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,10]);
 if(!B||C.equals(D)||C[1]==D[1]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('b',false);xy[1]+=2;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');
 this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
-,zIndex:20001,clickHander:false,onMouseDown:function(e){if(this.popup.length&&!e.getTarget(".roo-popover")&&this.popup.length){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
-}A.on('show',Roo.bootstrap.Popover.onShow,Roo.bootstrap.Popover,A);A.on('hide',Roo.bootstrap.Popover.onHide,Roo.bootstrap.Popover,A);this.hideAll();this.popups.push(A);},hideAll:function(){this.popups.forEach(function(p){p.hide();});},onShow:function(p){this.popups.push(p);
+,zIndex:20001,clickHander:false,onMouseDown:function(e){if(this.popups.length&&!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
+}A.on('show',Roo.bootstrap.Popover.onShow,A);A.on('hide',Roo.bootstrap.Popover.onHide,A);this.hideAll();},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);
 }});
 // Roo/bootstrap/PopoverNav.js
 Roo.bootstrap.PopoverNav=function(A){Roo.bootstrap.PopoverNav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.PopoverNav,Roo.bootstrap.NavSimplebar,{container_method:'getPopoverHeader'});
 }});
 // Roo/bootstrap/PopoverNav.js
 Roo.bootstrap.PopoverNav=function(A){Roo.bootstrap.PopoverNav.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.PopoverNav,Roo.bootstrap.NavSimplebar,{container_method:'getPopoverHeader'});