From 1e8b059849562b68980037f264f688828b91a332 Mon Sep 17 00:00:00 2001 From: leon Date: Thu, 29 Sep 2022 13:02:05 +0800 Subject: [PATCH] Roo/bootstrap/Tooltip.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Tooltip.js | 14 +++++++------- roojs-bootstrap-debug.js | 14 +++++++------- roojs-bootstrap.js | 13 ++++++------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Roo/bootstrap/Tooltip.js b/Roo/bootstrap/Tooltip.js index 22f8559574..16e39b7da0 100644 --- a/Roo/bootstrap/Tooltip.js +++ b/Roo/bootstrap/Tooltip.js @@ -246,16 +246,14 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component, { this.el.removeClass(['fade','top','bottom', 'left', 'right','in', 'bs-tooltip-top','bs-tooltip-bottom', 'bs-tooltip-left', 'bs-tooltip-right']); - Roo.log("TOOLTIP CLASS"); - Roo.log(this.bindEl.attr('tooltip-class')); - this.el.addClass(this.bindEl.attr('tooltip-class')); + if(this.bindEl.attr('tooltip-class')) { + this.el.addClass(this.bindEl.attr('tooltip-class')); + } var placement = typeof this.placement == 'function' ? this.placement.call(this, this.el, on_el) : this.placement; - - Roo.log("TOOLTIP PLACEMENT"); - Roo.log(this.bindEl.attr('tooltip-placement')); + if(this.bindEl.attr('tooltip-placement')) { placement = this.bindEl.attr('tooltip-placement'); } @@ -348,7 +346,9 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component, { return; } //this.el.setXY([0,0]); - this.el.removeClass(this.bindEl.attr('tooltip-class')); + if(this.bindEl.attr('tooltip-class')) { + this.el.removeClass(this.bindEl.attr('tooltip-class')); + } this.el.removeClass(['show', 'in']); //this.el.hide(); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 4644c3c803..184111c7cd 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -32759,16 +32759,14 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component, { this.el.removeClass(['fade','top','bottom', 'left', 'right','in', 'bs-tooltip-top','bs-tooltip-bottom', 'bs-tooltip-left', 'bs-tooltip-right']); - Roo.log("TOOLTIP CLASS"); - Roo.log(this.bindEl.attr('tooltip-class')); - this.el.addClass(this.bindEl.attr('tooltip-class')); + if(this.bindEl.attr('tooltip-class')) { + this.el.addClass(this.bindEl.attr('tooltip-class')); + } var placement = typeof this.placement == 'function' ? this.placement.call(this, this.el, on_el) : this.placement; - - Roo.log("TOOLTIP PLACEMENT"); - Roo.log(this.bindEl.attr('tooltip-placement')); + if(this.bindEl.attr('tooltip-placement')) { placement = this.bindEl.attr('tooltip-placement'); } @@ -32861,7 +32859,9 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component, { return; } //this.el.setXY([0,0]); - this.el.removeClass(this.bindEl.attr('tooltip-class')); + if(this.bindEl.attr('tooltip-class')) { + this.el.removeClass(this.bindEl.attr('tooltip-class')); + } this.el.removeClass(['show', 'in']); //this.el.hide(); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 3ab12ef799..bd81ff69e6 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1418,13 +1418,12 @@ if(!this.currentEl){return;}if(A!=this.currentEl.dom){return;}var xy=ev.getXY(); ]};return A;},bind:function(el){this.bindEl=el;},initEvents:function(){this.arrowEl=this.el.select('.arrow',true).first();this.innerEl=this.el.select('.tooltip-inner',true).first();},enter:function(){if(this.timeout!=null){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();Roo.bootstrap.Tooltip.currentEl=false;}},delay);},show:function(A){if(!this.el){this.render(document.body);}var B=A||this.bindEl.attr('tooltip')||this.bindEl.select("[tooltip]").first().attr('tooltip'); -this.el.select('.tooltip-inner',true).first().dom.innerHTML=B;this.el.removeClass(['fade','top','bottom','left','right','in','bs-tooltip-top','bs-tooltip-bottom','bs-tooltip-left','bs-tooltip-right']);Roo.log("TOOLTIP CLASS");Roo.log(this.bindEl.attr('tooltip-class')); -this.el.addClass(this.bindEl.attr('tooltip-class'));var C=typeof this.placement=='function'?this.placement.call(this,this.el,on_el):this.placement;Roo.log("TOOLTIP PLACEMENT");Roo.log(this.bindEl.attr('tooltip-placement'));if(this.bindEl.attr('tooltip-placement')){C=this.bindEl.attr('tooltip-placement'); -}var D=/\s?auto?\s?/i;var E=D.test(C);if(E){C=C.replace(D,'')||'top';}this.el.show();var p=this.getPosition();var F=this.el.getBox();if(E){}var G=this.alignment[C];var xy=this.el.getAlignToXY(this.bindEl,G[0],G[1]);if(C=='top'||C=='bottom'){if(xy[0]<0){C='right'; -}if(xy[0]+this.el.getWidth()>Roo.lib.Dom.getViewWidth()){C='left';}var H=Roo.select('body',true).first().getScroll();if(xy[1]>Roo.lib.Dom.getViewHeight()+H.top-this.el.getHeight()){C='top';}G=this.alignment[C];this.arrowEl.setLeft((this.innerEl.getWidth()/2)-5); -}var I=document.getElementsByTagName('div');var J=Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1);for(var i=0;iJ){J=K;}}this.el.dom.style.zIndex=J; -this.el.alignTo(this.bindEl,G[0],G[1]);this.el.addClass(C);this.el.addClass("bs-tooltip-"+C);this.el.addClass('in fade show');this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){if(!this.el){return;}this.el.removeClass(this.bindEl.attr('tooltip-class')); -this.el.removeClass(['show','in']);}}); +this.el.select('.tooltip-inner',true).first().dom.innerHTML=B;this.el.removeClass(['fade','top','bottom','left','right','in','bs-tooltip-top','bs-tooltip-bottom','bs-tooltip-left','bs-tooltip-right']);if(this.bindEl.attr('tooltip-class')){this.el.addClass(this.bindEl.attr('tooltip-class')); +}var C=typeof this.placement=='function'?this.placement.call(this,this.el,on_el):this.placement;if(this.bindEl.attr('tooltip-placement')){C=this.bindEl.attr('tooltip-placement');}var D=/\s?auto?\s?/i;var E=D.test(C);if(E){C=C.replace(D,'')||'top';}this.el.show(); +var p=this.getPosition();var F=this.el.getBox();if(E){}var G=this.alignment[C];var xy=this.el.getAlignToXY(this.bindEl,G[0],G[1]);if(C=='top'||C=='bottom'){if(xy[0]<0){C='right';}if(xy[0]+this.el.getWidth()>Roo.lib.Dom.getViewWidth()){C='left';}var H=Roo.select('body',true).first().getScroll(); +if(xy[1]>Roo.lib.Dom.getViewHeight()+H.top-this.el.getHeight()){C='top';}G=this.alignment[C];this.arrowEl.setLeft((this.innerEl.getWidth()/2)-5);}var I=document.getElementsByTagName('div');var J=Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1);for(var i=0;iJ){J=K;}}this.el.dom.style.zIndex=J;this.el.alignTo(this.bindEl,G[0],G[1]);this.el.addClass(C);this.el.addClass("bs-tooltip-"+C);this.el.addClass('in fade show'); +this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){if(!this.el){return;}if(this.bindEl.attr('tooltip-class')){this.el.removeClass(this.bindEl.attr('tooltip-class'));}this.el.removeClass(['show','in']);}}); // Roo/bootstrap/LocationPicker.js Roo.bootstrap.LocationPicker=function(A){Roo.bootstrap.LocationPicker.superclass.constructor.call(this,A);this.addEvents({initial:true,positionchanged:true,resize:true,show:true,hide:true,mapClick:true,mapRightClick:true,markerClick:true,markerRightClick:true,OverlayViewDraw:true,OverlayViewOnAdd:true,OverlayViewOnRemove:true,OverlayViewShow:true,OverlayViewHide:true,loadexception:true} );};Roo.extend(Roo.bootstrap.LocationPicker,Roo.bootstrap.Component,{gMapContext:false,latitude:0,longitude:0,zoom:15,mapTypeId:false,mapTypeControl:false,disableDoubleClickZoom:false,scrollwheel:true,streetViewControl:false,radius:0,locationName:'',draggable:true,enableAutocomplete:false,enableReverseGeocode:true,markerTitle:'',getAutoCreate:function(){var A={tag:'div',cls:'roo-location-picker'} -- 2.39.2