From: Alan Knowles Date: Thu, 11 Feb 2021 04:33:54 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=fbd44104827f9c2895b6170e80a7c369718ab29d roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f7091fd77e..ae49d799a1 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -19935,7 +19935,9 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { */ updatePosition : function(placement, try_move) { + // allow for calling with no parameters placement = placement ? placement : this.placement; + try_move = typeof(try_move) == 'undefined' ? true : try_move; this.el.removeClass([ 'fade','top','bottom', 'left', 'right','in', diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6172f10f91..3d12d5e928 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -822,7 +822,7 @@ var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='clic A=A||false;if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;}else if(this.over){Roo.get(this.over);}}this.alignEl=A;if(!this.el){this.render(document.body);}if(this.title===false){this.headerEl.hide();}this.el.show(); this.el.dom.style.display='block';if(this.alignEl){this.updatePosition(this.placement,true);}else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}this.el.addClass('in'); 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;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+' roo-popover-'+A); +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+' roo-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]+=2;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);