From fd007fb64343a6f37c0e3fd9cac8aa01b236d83e Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 11 Feb 2021 12:49:04 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js --- roojs-bootstrap-debug.js | 4 ++-- roojs-bootstrap.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 97eb94302d..92cdce6707 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -19962,7 +19962,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { return true; } // continue through... - try_move = false; + return this.updatePosition('left', false); case 'left': @@ -19991,7 +19991,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { return true; } // fall through - try_move = false; + return this.updatePosition('bottom', false); case 'bottom': var exact = this.el.getAlignToXY(this.alignEl, 't-b', [0,10]); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 929b74afef..d38e0d6a40 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -824,11 +824,11 @@ this.el.dom.style.display='block';if(this.alignEl){this.updatePosition(this.plac this.hoverState='in';if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++); this.fireEvent('show',this);},updatePosition:function(A,B){A=A?A:this.placement;B=typeof(B)=='undefined'?true:B;this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);this.el.addClass(A+' bs-popover-'+A); if(!this.alignEl){return false;}switch(A){case 'right':var C=this.el.getAlignToXY(this.alignEl,'tl-tr',[10,0]);var D=this.el.getAlignToXY(this.alignEl,'tl-tr?',[10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('tr',false); -xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}B=false;case 'left':var C=this.el.getAlignToXY(this.alignEl,'tr-tl',[-10,0]);var D=this.el.getAlignToXY(this.alignEl,'tr-tl?',[-10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.el.setXY(D);var xy=this.alignEl.getAnchorXY('tl',false); -xy[0]-=10;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('right',false);case 'top':var C=this.el.getAlignToXY(this.alignEl,'b-t',[0,-10]);var D=this.el.getAlignToXY(this.alignEl,'b-t?',[0,-10]);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;}B=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']} +xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('left',false);case 'left':var C=this.el.getAlignToXY(this.alignEl,'tr-tl',[-10,0]);var D=this.el.getAlignToXY(this.alignEl,'tr-tl?',[-10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.el.setXY(D); +var xy=this.alignEl.getAnchorXY('tl',false);xy[0]-=10;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('right',false);case 'top':var C=this.el.getAlignToXY(this.alignEl,'b-t',[0,-10]);var D=this.el.getAlignToXY(this.alignEl,'b-t?',[0,-10]); +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(!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); }this.hideAll();this.popups.push(A);},hideAll:function(){this.popups.forEach(function(p){p.hide();});}}); // Roo/bootstrap/PopoverNav.js -- 2.39.2