From 6edd618d53fc0e82c8ec39d6410ce57b6dd8bded Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 11 Feb 2021 12:09:25 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/Popover.js --- Roo/bootstrap/Popover.js | 10 +++------- roojs-bootstrap-debug.js | 10 +++------- roojs-bootstrap.js | 7 +++---- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Roo/bootstrap/Popover.js b/Roo/bootstrap/Popover.js index 061971e4e1..bc7b520ae9 100644 --- a/Roo/bootstrap/Popover.js +++ b/Roo/bootstrap/Popover.js @@ -286,10 +286,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { } - this.el.removeClass([ - 'fade','top','bottom', 'left', 'right','in', - 'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right' - ]); + if (this.title === false) { this.headerEl.hide(); @@ -300,10 +297,9 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { this.el.dom.style.display = 'block'; - this.el.addClass(placement + ' roo-popover-' + placement); - + if (on_el) { - this.updatePosition(); + this.updatePosition(placement); } else { // this is usually just done by the builder = to show the popoup in the middle of the scren. diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 3294f2cd6d..85f9c9f1e9 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -19882,10 +19882,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { } - this.el.removeClass([ - 'fade','top','bottom', 'left', 'right','in', - 'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right' - ]); + if (this.title === false) { this.headerEl.hide(); @@ -19896,10 +19893,9 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component, { this.el.dom.style.display = 'block'; - this.el.addClass(placement + ' roo-popover-' + placement); - + if (on_el) { - this.updatePosition(); + this.updatePosition(placement); } else { // this is usually just done by the builder = to show the popoup in the middle of the scren. diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 8571ca6c07..4a62b51643 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -819,10 +819,9 @@ this.headerEl.setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode(' var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='click'){A.on('click',this.toggle,this);}else if(C!='manual'){var D=C=='hover'?'mouseenter':'focusin';var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.leave,this); }},this);},timeout:null,hoverState:null,toggle:function(){this.hoverState=='in'?this.leave():this.enter();},enter:function(){clearTimeout(this.timeout);this.hoverState='in';if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show(); }},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},show:function(A,B){this.placement=typeof(B)=='undefined'?this.placement:B; -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);}}if(!this.el){this.render(document.body);}this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']); -if(this.title===false){this.headerEl.hide();}this.el.show();this.el.dom.style.display='block';this.el.addClass(B+' roo-popover-'+B);if(A){this.updatePosition();}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){this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']); +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);}}if(!this.el){this.render(document.body);}if(this.title===false){this.headerEl.hide();}this.el.show();this.el.dom.style.display='block'; +if(A){this.updatePosition(B);}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){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.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.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,'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.setXY(D); -- 2.39.2