Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / QuickTip.html
index 6cd90d3..f0ada14 100644 (file)
@@ -1,5 +1,6 @@
 <html>\r
 <head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \r
   <title>The source code</title>\r
     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
@@ -8,6 +9,7 @@
     <pre class="prettyprint lang-js"><div id="cls-Ext.QuickTip"></div>/**\r
  * @class Ext.QuickTip\r
  * @extends Ext.ToolTip\r
+ * @xtype quicktip\r
  * A specialized tooltip class for tooltips that can be specified in markup and automatically managed by the global\r
  * {@link Ext.QuickTips} instance.  See the QuickTips class header for additional usage details and examples.\r
  * @constructor\r
@@ -96,6 +98,22 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
             this.clearTimer('show');\r
         }\r
     },\r
+    \r
+    getTipCfg: function(e) {\r
+        var t = e.getTarget(), \r
+            ttp, \r
+            cfg;\r
+        if(this.interceptTitles && t.title && Ext.isString(t.title)){\r
+            ttp = t.title;\r
+            t.qtip = ttp;\r
+            t.removeAttribute("title");\r
+            e.preventDefault();\r
+        }else{\r
+            cfg = this.tagConfig;\r
+            ttp = t.qtip || Ext.fly(t).getAttribute(cfg.attribute, cfg.namespace);\r
+        }\r
+        return ttp;\r
+    },\r
 \r
     // private\r
     onTargetOver : function(e){\r
@@ -107,7 +125,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         if(!t || t.nodeType !== 1 || t == document || t == document.body){\r
             return;\r
         }\r
-        if(this.activeTarget && t == this.activeTarget.el){\r
+        if(this.activeTarget && ((t == this.activeTarget.el) || Ext.fly(this.activeTarget.el).contains(t))){\r
             this.clearTimer('hide');\r
             this.show();\r
             return;\r
@@ -122,18 +140,8 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
             this.delayShow();\r
             return;\r
         }\r
-        \r
-        var ttp, et = Ext.fly(t), cfg = this.tagConfig;\r
-        var ns = cfg.namespace;\r
-        if(this.interceptTitles && t.title){\r
-            ttp = t.title;\r
-            t.qtip = ttp;\r
-            t.removeAttribute("title");\r
-            e.preventDefault();\r
-        } else{\r
-            ttp = t.qtip || et.getAttribute(cfg.attribute, ns);\r
-        }\r
-        if(ttp){\r
+        var ttp, et = Ext.fly(t), cfg = this.tagConfig, ns = cfg.namespace;\r
+        if(ttp = this.getTipCfg(e)){\r
             var autoHide = et.getAttribute(cfg.hide, ns);\r
             this.activeTarget = {\r
                 el: t,\r
@@ -155,6 +163,12 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
 \r
     // private\r
     onTargetOut : function(e){\r
+\r
+        // If moving within the current target, and it does not have a new tip, ignore the mouseout\r
+        if (this.activeTarget && e.within(this.activeTarget.el) && !this.getTipCfg(e)) {\r
+            return;\r
+        }\r
+\r
         this.clearTimer('show');\r
         if(this.autoHide !== false){\r
             this.delayHide();\r
@@ -205,6 +219,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         delete this.activeTarget;\r
         Ext.QuickTip.superclass.hide.call(this);\r
     }\r
-});</pre>    \r
+});\r
+Ext.reg('quicktip', Ext.QuickTip);</pre>    \r
 </body>\r
 </html>
\ No newline at end of file