roojs-bootstrap.js
authoredward <edward@roojs.com>
Tue, 21 Nov 2017 07:57:39 +0000 (15:57 +0800)
committeredward <edward@roojs.com>
Tue, 21 Nov 2017 07:57:39 +0000 (15:57 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 78b6ae1..b47e784 100644 (file)
@@ -7442,6 +7442,9 @@ Roo.form.Action.ACTION_TYPES = {
 
 Roo.bootstrap.Form = function(config){
     Roo.bootstrap.Form.superclass.constructor.call(this, config);
+    
+    Roo.bootstrap.Form.popover.apply();
+    
     this.addEvents({
         /**
          * @event clientvalidation
@@ -7563,19 +7566,6 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component,  {
             return false;
         });
         
-        this.errTooltip = new Roo.bootstrap.Tooltip({
-            cls : 'roo-form-error-popover'
-        });
-        
-        this.errTooltip.render(this.el);
-        
-        this.errTooltip.alignment = {
-            'left' : ['r-l', [-2,0], 'right'],
-            'right' : ['l-r', [2,0], 'left'],
-            'bottom' : ['tl-bl', [0,2], 'top'],
-            'top' : [ 'bl-tl', [0,-2], 'bottom']
-        };
-        
     },
     // private
     onSubmit : function(e){
@@ -7606,80 +7596,12 @@ Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component,  {
         });
         
         if(this.errPopover && !valid){
-            this.showErrPopover(target);
+            Roo.bootstrap.Form.popover.mask(this, target);
         }
         
         return valid;
     },
     
-    showErrPopover : function(target)
-    {
-        if(!this.errPopover){
-            return;
-        }
-        
-        /*
-         * Mask the element
-         */
-        var oIndex = target.el.getStyle('z-index');
-        
-        target.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
-        
-        target.el.addClass('roo-invalid-outline');
-        
-        target.inputEl().focus();
-        
-        /*
-         * Place the popover
-         */
-        this.errTooltip.bindEl = target.el;
-        
-        this.errTooltip.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
-        
-        var tip = target.blankText;
-        
-        if(target.getValue() !== '' && target.regexText.length){
-            tip = target.regexText;
-        }
-        
-        this.errTooltip.show(tip);
-        
-        var _this = this;
-        
-        var fadeout = function(){
-            
-            target.inputEl().un('blur', fadeout);
-            target.inputEl().un('keyup', fadeout);
-            
-            target.el.setStyle('z-index', oIndex);
-        
-            target.el.removeClass('roo-invalid-outline');
-            
-            _this.errTooltip.hide();
-            
-            if(!intervalFadeOut){
-                return;
-            }
-            
-            window.clearInterval(intervalFadeOut);
-            intervalFadeOut = false;
-                
-        }
-        
-        target.inputEl().on('blur', fadeout, target);
-        target.inputEl().on('keyup', fadeout, target);
-        
-        if(intervalFadeOut){
-            window.clearInterval(intervalFadeOut);
-            intervalFadeOut = false;
-        }
-        
-        var intervalFadeOut =  window.setInterval(function() {
-            fadeout();
-        }, 10000);
-          
-    },
-    
     /**
      * Returns true if any fields in this form have changed since their original load.
      * @return Boolean
@@ -8042,6 +7964,119 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
     }
 
 });
+
+Roo.apply(Roo.bootstrap.Form, {
+    
+    popover : {
+        
+        isApplied : false,
+        
+        isMasked : false,
+        
+        form : false,
+        
+        target : false,
+        
+        oIndex : false,
+        
+        toolTip : false,
+        
+        intervalID : false,
+    
+        apply : function()
+        {
+            if(this.isApplied){
+                return;
+            }
+            
+            this.toolTip = new Roo.bootstrap.Tooltip({
+                cls : 'roo-form-error-popover',
+                alignment : {
+                    'left' : ['r-l', [-2,0], 'right'],
+                    'right' : ['l-r', [2,0], 'left'],
+                    'bottom' : ['tl-bl', [0,2], 'top'],
+                    'top' : [ 'bl-tl', [0,-2], 'bottom']
+                }
+            });
+            
+            this.toolTip.render(Roo.get(document.body));
+
+            Roo.get(document.body).on('click', function(){
+                this.unmask();
+            }, this);
+            
+            this.isApplied = true
+        },
+        
+        mask : function(form, target)
+        {
+            this.form = form;
+            
+            this.target = target;
+            
+            if(!this.form.errPopover){
+                return;
+            }
+
+            this.oIndex = target.el.getStyle('z-index');
+            
+            this.target.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
+        
+            this.target.el.addClass('roo-invalid-outline');
+
+            this.target.el.dom.scrollIntoView();
+            
+            this.toolTip.bindEl = this.target.el;
+        
+            this.toolTip.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
+
+            var tip = this.target.blankText;
+
+            if(this.target.getValue() !== '' && this.target.regexText.length){
+                tip = this.target.regexText;
+            }
+
+            this.toolTip.show(tip);
+            
+            this.intervalID = window.setInterval(function() {
+                Roo.bootstrap.Form.popover.unmask();
+            }, 10000);
+
+            window.onwheel = function(){ return false;};
+            
+            (function(){ this.isMasked = true; }).defer(500, this);
+            
+        },
+        
+        unmask : function()
+        {
+            if(!this.isApplied || !this.isMasked || !this.form || !this.target || !this.form.errPopover){
+                return;
+            }
+            
+            if(this.oIndex){
+                this.target.el.setStyle('z-index', this.oIndex);
+            }
+            
+            this.target.el.removeClass('roo-invalid-outline');
+            
+            this.toolTip.hide();
+            
+            window.onwheel = function(){ return true;};
+            
+            if(this.intervalID){
+                window.clearInterval(this.intervalID);
+                this.intervalID = false;
+            }
+            
+            this.isMasked = false;
+            
+        }
+        
+    }
+    
+});
+
 /*
  * Based on:
  * Ext JS Library 1.1.1
@@ -24729,6 +24764,13 @@ Roo.extend(Roo.bootstrap.menu.Separator, Roo.bootstrap.Component,  {
 
 Roo.bootstrap.Tooltip = function(config){
     Roo.bootstrap.Tooltip.superclass.constructor.call(this, config);
+    
+    this.alignment = Roo.bootstrap.Tooltip.alignment;
+    
+    if(typeof(config) != 'undefined' && typeof(config.alignment) != 'undefined'){
+        this.alignment = config.alignment;
+    }
+    
 };
 
 Roo.apply(Roo.bootstrap.Tooltip, {
@@ -24854,6 +24896,8 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
     
     placement : 'bottom', 
     
+    alignment : false,
+    
     getAutoCreate : function(){
     
         var cfg = {
@@ -24955,7 +24999,7 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
             // fixme..
         }
         
-        var align = this.alignment ? this.alignment[placement] : Roo.bootstrap.Tooltip.alignment[placement];
+        var align = this.alignment[placement];
         
         var xy = this.el.getAlignToXY(this.bindEl, align[0], align[1]);
         
index 7b10c9f..12c1e67 100644 (file)
@@ -300,24 +300,27 @@ this.reader=this.form.reader;};Roo.extend(Roo.form.Action.Load,Roo.form.Action,{
 if(B===true||!B.success||!B.data){this.failureType=Roo.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return;}this.form.clearInvalid();this.form.setValues(B.data);this.form.afterAction(this,true);},handleResponse:function(A){if(this.form.reader){var rs=this.form.reader.read(A);
 var B=rs.records&&rs.records[0]?rs.records[0].data:null;return {success:rs.success,data:B};}return Roo.decode(A.responseText);}});Roo.form.Action.ACTION_TYPES={'load':Roo.form.Action.Load,'submit':Roo.form.Action.Submit};
 // Roo/bootstrap/Form.js
-Roo.bootstrap.Form=function(A){Roo.bootstrap.Form.superclass.constructor.call(this,A);this.addEvents({clientvalidation:true,beforeaction:true,actionfailed:true,actioncomplete:true});};Roo.extend(Roo.bootstrap.Form,Roo.bootstrap.Component,{method:'POST',timeout:30,align:'left',activeAction:null,waitMsgTarget:false,loadMask:true,errPopover:false,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''}
+Roo.bootstrap.Form=function(A){Roo.bootstrap.Form.superclass.constructor.call(this,A);Roo.bootstrap.Form.popover.apply();this.addEvents({clientvalidation:true,beforeaction:true,actionfailed:true,actioncomplete:true});};Roo.extend(Roo.bootstrap.Form,Roo.bootstrap.Component,{method:'POST',timeout:30,align:'left',activeAction:null,waitMsgTarget:false,loadMask:true,errPopover:false,getAutoCreate:function(){var A={tag:'form',method:this.method||'POST',id:this.id||Roo.id(),cls:''}
 ;if(this.parent().xtype.match(/^Nav/)){A.cls='navbar-form navbar-'+this.align;}if(this.labelAlign=='left'){A.cls+=' form-horizontal';}return A;},initEvents:function(){this.el.on('submit',this.onSubmit,this);this.el.on('keypress',function(e){if(e.getCharCode()!=13){return true;
-}if(e.getTarget().nodeName.toLowerCase()==='textarea'){return true;}Roo.log("keypress blocked");e.preventDefault();return false;});this.errTooltip=new Roo.bootstrap.Tooltip({cls:'roo-form-error-popover'});this.errTooltip.render(this.el);this.errTooltip.alignment={'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['tl-bl',[0,2],'top'],'top':['bl-tl',[0,-2],'bottom']}
-;},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=this.getItems();var B=true;var C=false;A.each(function(f){if(f.validate()){return;}B=false;if(!C&&f.el.isVisible(true)){C=f;}});if(this.errPopover&&!B){this.showErrPopover(C);}return B;},showErrPopover:function(A){if(!this.errPopover){return;
-}var B=A.el.getStyle('z-index');A.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);A.el.addClass('roo-invalid-outline');A.inputEl().focus();this.errTooltip.bindEl=A.el;this.errTooltip.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);var C=A.blankText;
-if(A.getValue()!==''&&A.regexText.length){C=A.regexText;}this.errTooltip.show(C);var D=this;var E=function(){A.inputEl().un('blur',E);A.inputEl().un('keyup',E);A.el.setStyle('z-index',B);A.el.removeClass('roo-invalid-outline');D.errTooltip.hide();if(!F){return;
-}window.clearInterval(F);F=false;};A.inputEl().on('blur',E,A);A.inputEl().on('keyup',E,A);if(F){window.clearInterval(F);F=false;}var F=window.setInterval(function(){E();},10000);},isDirty:function(){var A=false;var B=this.getItems();B.each(function(f){if(f.isDirty()){A=true;
-return false;}return true;});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},beforeAction:function(A){var o=A.options;
-if(this.loadMask){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}},afterAction:function(A,B){this.activeAction=null;var o=A.options;this.el.unmask();if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);
-}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;Roo.log("not supported yet");return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.log("need to add dialog support");
-}this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.getItems();var B=A.get(id);if(!B){A.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){B=f;return false;}return true;});}return B||null;},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;
-i<B;i++){var C=A[i];var f=this.findField(C.id);if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}return this;},setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;
-i<B;i++){var v=A[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={}
-;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}return this;},getValues:function(A){var fs=Roo.lib.Ajax.serializeForm(this.el.dom);
-if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){var B=this.getItems();var C={};B.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(C[f.getName()])=='undefined'){C[f.getName()]='';
-}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();}if(f.name!==false&&f.name!=''&&f.name!=f.getName()){C[f.name]=f.getRawValue();}C[f.getName()]=v;});return C;},clearInvalid:function(){var A=this.getItems();
-A.each(function(f){f.clearInvalid();});return this;},reset:function(){var A=this.getItems();A.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();});return this;},getItems:function(){var r=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());
-});var A=function(el){if(el.inputEl){r.add(el);}if(!el.items){return;}Roo.each(el.items,function(e){A(e);});};A(this);return r;}});
+}if(e.getTarget().nodeName.toLowerCase()==='textarea'){return true;}Roo.log("keypress blocked");e.preventDefault();return false;});},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=this.getItems();var B=true;var C=false;A.each(function(f){if(f.validate()){return;
+}B=false;if(!C&&f.el.isVisible(true)){C=f;}});if(this.errPopover&&!B){Roo.bootstrap.Form.popover.mask(this,C);}return B;},isDirty:function(){var A=false;var B=this.getItems();B.each(function(f){if(f.isDirty()){A=true;return false;}return true;});return A;
+},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},beforeAction:function(A){var o=A.options;if(this.loadMask){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');
+}},afterAction:function(A,B){this.activeAction=null;var o=A.options;this.el.unmask();if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
+Roo.log("not supported yet");return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.log("need to add dialog support");}this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.getItems();var B=A.get(id);
+if(!B){A.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){B=f;return false;}return true;});}return B||null;},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var C=A[i];var f=this.findField(C.id);
+if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}return this;},setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var v=A[i];var f=this.findField(v.id);
+if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={};sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];
+sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}return this;},getValues:function(A){var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(A===true){return fs;
+}return Roo.urlDecode(fs);},getFieldValues:function(A){var B=this.getItems();var C={};B.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(C[f.getName()])=='undefined'){C[f.getName()]='';}if(!f.el.dom.checked){return;
+}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();}if(f.name!==false&&f.name!=''&&f.name!=f.getName()){C[f.name]=f.getRawValue();}C[f.getName()]=v;});return C;},clearInvalid:function(){var A=this.getItems();A.each(function(f){f.clearInvalid();
+});return this;},reset:function(){var A=this.getItems();A.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();});return this;},getItems:function(){var r=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());
+});var A=function(el){if(el.inputEl){r.add(el);}if(!el.items){return;}Roo.each(el.items,function(e){A(e);});};A(this);return r;}});Roo.apply(Roo.bootstrap.Form,{popover:{isApplied:false,isMasked:false,form:false,target:false,oIndex:false,toolTip:false,intervalID:false,apply:function(){if(this.isApplied){return;
+}this.toolTip=new Roo.bootstrap.Tooltip({cls:'roo-form-error-popover',alignment:{'left':['r-l',[-2,0],'right'],'right':['l-r',[2,0],'left'],'bottom':['tl-bl',[0,2],'top'],'top':['bl-tl',[0,-2],'bottom']}});this.toolTip.render(Roo.get(document.body));Roo.get(document.body).on('click',function(){this.unmask();
+},this);this.isApplied=true},mask:function(A,B){this.form=A;this.target=B;if(!this.form.errPopover){return;}this.oIndex=B.el.getStyle('z-index');this.target.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.target.el.addClass('roo-invalid-outline');
+this.target.el.dom.scrollIntoView();this.toolTip.bindEl=this.target.el;this.toolTip.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);var C=this.target.blankText;if(this.target.getValue()!==''&&this.target.regexText.length){C=this.target.regexText;}this.toolTip.show(C);
+this.intervalID=window.setInterval(function(){Roo.bootstrap.Form.popover.unmask();},10000);window.onwheel=function(){return false;};(function(){this.isMasked=true;}).defer(500,this);},unmask:function(){if(!this.isApplied||!this.isMasked||!this.form||!this.target||!this.form.errPopover){return;
+}if(this.oIndex){this.target.el.setStyle('z-index',this.oIndex);}this.target.el.removeClass('roo-invalid-outline');this.toolTip.hide();window.onwheel=function(){return true;};if(this.intervalID){window.clearInterval(this.intervalID);this.intervalID=false;
+}this.isMasked=false;}}});
 // Roo/form/VTypes.js
 Roo.form.VTypes=function(){var A=/^[a-zA-Z_]+$/;var B=/^[a-zA-Z0-9_]+$/;var C=/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;var D=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return {'email':function(v){return C.test(v);
 },'emailText':'This field should be an e-mail address in the format "user@domain.com"','emailMask':/[a-z0-9_\.\-@]/i,'url':function(v){return D.test(v);},'urlText':'This field should be a URL in the format "http:/'+'/www.domain.com"','alpha':function(v){return A.test(v);
@@ -1015,15 +1018,16 @@ if(this.pos=='left'){B.cls=(typeof(B.cls)=='undefined')?'pull-left':(B.cls+' pul
 Roo.bootstrap.menu=Roo.bootstrap.menu||{};Roo.bootstrap.menu.Separator=function(A){Roo.bootstrap.menu.Separator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.menu.Separator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'li',cls:'divider'}
 ;return A;}});
 // 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||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();
+Roo.bootstrap.Tooltip=function(A){Roo.bootstrap.Tooltip.superclass.constructor.call(this,A);this.alignment=Roo.bootstrap.Tooltip.alignment;if(typeof(A)!='undefined'&&typeof(A.alignment)!='undefined'){this.alignment=A.alignment;}};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||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',alignment:false,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;
 }},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?this.alignment[C]:Roo.bootstrap.Tooltip.alignment[C];
+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();if(xy[1]>Roo.lib.Dom.getViewHeight()+H.top-this.el.getHeight()){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');}});
 // Roo/bootstrap/LocationPicker.js