sync
authorjohn <john@roojs.com>
Fri, 21 Sep 2018 10:40:21 +0000 (18:40 +0800)
committerjohn <john@roojs.com>
Fri, 21 Sep 2018 10:40:21 +0000 (18:40 +0800)
Roo/bootstrap/Tooltip.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 8645ebd..6dc7299 100644 (file)
@@ -274,6 +274,7 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
                 placement = 'top';
             }
             
+            align = this.alignment[placement];
         }
         
         this.el.alignTo(this.bindEl, align[0],align[1]);
index 4c7def3..456b8fb 100644 (file)
@@ -26207,14 +26207,11 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
             
             var scroll = Roo.select('body', true).first().getScroll();
             
-            Roo.log(xy[1]);
-            Roo.log(this.el.getHeight());
-            Roo.log(Roo.lib.Dom.getViewHeight());
-            
-            if((xy[1] + this.el.getHeight()) >= (Roo.lib.Dom.getViewHeight() + scroll.top)){
+            if(xy[1] > Roo.lib.Dom.getViewHeight() + scroll.top - this.el.getHeight()){
                 placement = 'top';
             }
             
+            align = this.alignment[placement];
         }
         
         this.el.alignTo(this.bindEl, align[0],align[1]);
index 25a497b..96b301e 100644 (file)
@@ -1088,9 +1088,8 @@ if(!B.getRegion().contains({top:xy[1],right:xy[0],bottom:xy[1],left:xy[0]})){ret
 }},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']);
 var C=typeof this.placement=='function'?this.placement.call(this,this.el,on_el):this.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();Roo.log(xy[1]);Roo.log(this.el.getHeight());
-Roo.log(Roo.lib.Dom.getViewHeight());if((xy[1]+this.el.getHeight())>=(Roo.lib.Dom.getViewHeight()+H.top)){C='top';}}this.el.alignTo(this.bindEl,G[0],G[1]);this.el.addClass(C);this.el.addClass('in fade');this.hoverState=null;if(this.el.hasClass('fade')){}}
-,hide:function(){if(!this.el){return;}this.el.removeClass('in');}});
+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.el.alignTo(this.bindEl,G[0],G[1]);this.el.addClass(C);this.el.addClass('in fade');this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){if(!this.el){return;}this.el.removeClass('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'}