Roo/bootstrap/Tooltip.js
authoredward <edward@roojs.com>
Wed, 2 Aug 2017 07:57:29 +0000 (15:57 +0800)
committeredward <edward@roojs.com>
Wed, 2 Aug 2017 07:57:29 +0000 (15:57 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Tooltip.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index c08aa6e..18fe186 100644 (file)
@@ -66,13 +66,12 @@ Roo.apply(Roo.bootstrap.Tooltip, {
         }    
         //Roo.log(ev);
         
-        if(!el){
+        if(!el || el.dom == document){
             return;
         }
         
         var bindEl = el;
         
-        Roo.log(el.dom);
         // you can not look for children, as if el is the body.. then everythign is the child..
         if (!el.attr('tooltip')) { //
             if (!el.select("[tooltip]").elements.length) {
index 77f6a14..bed19d5 100644 (file)
@@ -24165,7 +24165,7 @@ Roo.apply(Roo.bootstrap.Tooltip, {
         }    
         //Roo.log(ev);
         
-        if(!el){
+        if(!el || el.dom == document){
             return;
         }
         
index a42b59b..4ef30ac 100644 (file)
@@ -994,8 +994,8 @@ Roo.bootstrap.menu=Roo.bootstrap.menu||{};Roo.bootstrap.menu.Separator=function(
 // Roo/bootstrap/Tooltip.js
 Roo.bootstrap.Tooltip=function(A){Roo.bootstrap.Tooltip.superclass.constructor.call(this,A);};Roo.apply(Roo.bootstrap.Tooltip,{currentEl:false,currentTip:false,currentRegion:false,init:function(){Roo.get(document).on('mouseover',this.enter,this);Roo.get(document).on('mouseout',this.leave,this);
 this.currentTip=new Roo.bootstrap.Tooltip();},enter:function(ev){var A=ev.getTarget();var el=Roo.fly(A);if(this.currentEl){if(this.currentEl==el){return;}if(A!=this.currentEl.dom&&this.currentEl.contains(A)){return;}}if(this.currentTip.el){this.currentTip.el.setVisibilityMode(Roo.Element.DISPLAY).hide();
-}if(!el){return;}var B=el;if(!el.attr('tooltip')){if(!el.select("[tooltip]").elements.length){return;}B=el.select("[tooltip]").first();var xy=ev.getXY();if(!B.getRegion().contains({top:xy[1],right:xy[0],bottom:xy[1],left:xy[0]})){return;}}this.currentEl=B;
-this.currentTip.bind(B);this.currentRegion=Roo.lib.Region.getRegion(A);this.currentTip.enter();},leave:function(ev){var A=ev.getTarget();if(!this.currentEl){return;}if(A!=this.currentEl.dom){return;}var xy=ev.getXY();if(this.currentRegion.contains(new Roo.lib.Region(xy[1],xy[0],xy[1],xy[0]))){return;
+}if(!el||el.dom==document){return;}var B=el;if(!el.attr('tooltip')){if(!el.select("[tooltip]").elements.length){return;}B=el.select("[tooltip]").first();var xy=ev.getXY();if(!B.getRegion().contains({top:xy[1],right:xy[0],bottom:xy[1],left:xy[0]})){return;
+}}this.currentEl=B;this.currentTip.bind(B);this.currentRegion=Roo.lib.Region.getRegion(A);this.currentTip.enter();},leave:function(ev){var A=ev.getTarget();if(!this.currentEl){return;}if(A!=this.currentEl.dom){return;}var xy=ev.getXY();if(this.currentRegion.contains(new Roo.lib.Region(xy[1],xy[0],xy[1],xy[0]))){return;
 }if(this.currentTip){this.currentTip.leave();}this.currentEl=false;},alignment:{'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['t-b',[0,2],'top'],'top':['b-t',[0,-2],'bottom']}});Roo.extend(Roo.bootstrap.Tooltip,Roo.bootstrap.Component,{bindEl:false,delay:null,timeout:null,hoverState:null,placement:'bottom',getAutoCreate:function(){var A={cls:'tooltip',role:'tooltip',cn:[{cls:'tooltip-arrow'}
 ,{cls:'tooltip-inner'}]};return A;},bind:function(el){this.bindEl=el;},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;