Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / docs / source / QuickTip.html
index 6cd90d3..10dfae7 100644 (file)
@@ -1,13 +1,20 @@
-<html>\r
-<head>\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
-</head>\r
-<body  onload="prettyPrint();">\r
-    <pre class="prettyprint lang-js"><div id="cls-Ext.QuickTip"></div>/**\r
+<html>
+<head>
+  <title>The source code</title>
+    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body  onload="prettyPrint();">
+    <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+<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
@@ -97,6 +104,23 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         }\r
     },\r
 \r
+    // private\r
+    getTipCfg: function(e) {\r
+        var t = e.getTarget(), \r
+            ttp, \r
+            cfg;\r
+        if(this.interceptTitles && 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
         if(this.disabled){\r
@@ -107,7 +131,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 +146,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 +169,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 +225,7 @@ Ext.QuickTip = Ext.extend(Ext.ToolTip, {
         delete this.activeTarget;\r
         Ext.QuickTip.superclass.hide.call(this);\r
     }\r
-});</pre>    \r
-</body>\r
+});\r
+Ext.reg('quicktip', Ext.QuickTip);</pre>
+</body>
 </html>
\ No newline at end of file