X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/src/widgets/tips/QuickTip.js diff --git a/src/widgets/tips/QuickTip.js b/src/widgets/tips/QuickTip.js index 81b5295c..8ef427b9 100644 --- a/src/widgets/tips/QuickTip.js +++ b/src/widgets/tips/QuickTip.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.0 + * Ext JS Library 3.0.3 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -7,6 +7,7 @@ /** * @class Ext.QuickTip * @extends Ext.ToolTip + * @xtype quicktip * A specialized tooltip class for tooltips that can be specified in markup and automatically managed by the global * {@link Ext.QuickTips} instance. See the QuickTips class header for additional usage details and examples. * @constructor @@ -96,6 +97,23 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { } }, + // private + getTipCfg: function(e) { + var t = e.getTarget(), + ttp, + cfg; + if(this.interceptTitles && t.title){ + ttp = t.title; + t.qtip = ttp; + t.removeAttribute("title"); + e.preventDefault(); + }else{ + cfg = this.tagConfig; + ttp = t.qtip || Ext.fly(t).getAttribute(cfg.attribute, cfg.namespace); + } + return ttp; + }, + // private onTargetOver : function(e){ if(this.disabled){ @@ -106,7 +124,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { if(!t || t.nodeType !== 1 || t == document || t == document.body){ return; } - if(this.activeTarget && t == this.activeTarget.el){ + if(this.activeTarget && ((t == this.activeTarget.el) || Ext.fly(this.activeTarget.el).contains(t))){ this.clearTimer('hide'); this.show(); return; @@ -121,18 +139,8 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { this.delayShow(); return; } - - var ttp, et = Ext.fly(t), cfg = this.tagConfig; - var ns = cfg.namespace; - if(this.interceptTitles && t.title){ - ttp = t.title; - t.qtip = ttp; - t.removeAttribute("title"); - e.preventDefault(); - } else{ - ttp = t.qtip || et.getAttribute(cfg.attribute, ns); - } - if(ttp){ + var ttp, et = Ext.fly(t), cfg = this.tagConfig, ns = cfg.namespace; + if(ttp = this.getTipCfg(e)){ var autoHide = et.getAttribute(cfg.hide, ns); this.activeTarget = { el: t, @@ -154,6 +162,12 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { // private onTargetOut : function(e){ + + // If moving within the current target, and it does not have a new tip, ignore the mouseout + if (this.activeTarget && e.within(this.activeTarget.el) && !this.getTipCfg(e)) { + return; + } + this.clearTimer('show'); if(this.autoHide !== false){ this.delayHide(); @@ -204,4 +218,5 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { delete this.activeTarget; Ext.QuickTip.superclass.hide.call(this); } -}); \ No newline at end of file +}); +Ext.reg('quicktip', Ext.QuickTip); \ No newline at end of file