X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/QuickTip.html diff --git a/docs/source/QuickTip.html b/docs/source/QuickTip.html index 6cd90d3d..f0ada14e 100644 --- a/docs/source/QuickTip.html +++ b/docs/source/QuickTip.html @@ -1,5 +1,6 @@ + The source code @@ -8,6 +9,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 +98,22 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { this.clearTimer('show'); } }, + + getTipCfg: function(e) { + var t = e.getTarget(), + ttp, + cfg; + if(this.interceptTitles && t.title && Ext.isString(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){ @@ -107,7 +125,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; @@ -122,18 +140,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, @@ -155,6 +163,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(); @@ -205,6 +219,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, { delete this.activeTarget; Ext.QuickTip.superclass.hide.call(this); } -});
+}); +Ext.reg('quicktip', Ext.QuickTip); \ No newline at end of file