Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / src / widgets / tips / ToolTip.js
index eda1b2f..7711e2b 100644 (file)
@@ -1,5 +1,5 @@
 /*!
 /*!
- * Ext JS Library 3.0.3
+ * Ext JS Library 3.1.0
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -189,18 +189,17 @@ myGrid.on('render', function(grid) {
         }\r
         if(this.anchor){\r
             this.targetCounter++;\r
         }\r
         if(this.anchor){\r
             this.targetCounter++;\r
-            var offsets = this.getOffsets();\r
-            var xy = (this.anchorToTarget && !this.trackMouse) ?\r
-                this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) :\r
-                this.targetXY;\r
-\r
-            var dw = Ext.lib.Dom.getViewWidth()-5;\r
-            var dh = Ext.lib.Dom.getViewHeight()-5;\r
-            var scrollX = (document.documentElement.scrollLeft || document.body.scrollLeft || 0)+5;\r
-            var scrollY = (document.documentElement.scrollTop || document.body.scrollTop || 0)+5;\r
-\r
-            var axy = [xy[0] + offsets[0], xy[1] + offsets[1]];\r
-            var sz = this.getSize();\r
+            var offsets = this.getOffsets(),\r
+                xy = (this.anchorToTarget && !this.trackMouse) ? this.el.getAlignToXY(this.anchorTarget, this.getAnchorAlign()) : this.targetXY,\r
+                dw = Ext.lib.Dom.getViewWidth() - 5,\r
+                dh = Ext.lib.Dom.getViewHeight() - 5,\r
+                de = document.documentElement,\r
+                bd = document.body,\r
+                scrollX = (de.scrollLeft || bd.scrollLeft || 0) + 5,\r
+                scrollY = (de.scrollTop || bd.scrollTop || 0) + 5,\r
+                axy = [xy[0] + offsets[0], xy[1] + offsets[1]]\r
+                sz = this.getSize();\r
+                \r
             this.anchorEl.removeClass(this.anchorCls);\r
 \r
             if(this.targetCounter < 2){\r
             this.anchorEl.removeClass(this.anchorCls);\r
 \r
             if(this.targetCounter < 2){\r
@@ -289,7 +288,8 @@ myGrid.on('render', function(grid) {
 \r
     // private\r
     getOffsets : function(){\r
 \r
     // private\r
     getOffsets : function(){\r
-        var offsets, ap = this.getAnchorPosition().charAt(0);\r
+        var offsets, \r
+            ap = this.getAnchorPosition().charAt(0);\r
         if(this.anchorToTarget && !this.trackMouse){\r
             switch(ap){\r
                 case 't':\r
         if(this.anchorToTarget && !this.trackMouse){\r
             switch(ap){\r
                 case 't':\r
@@ -509,6 +509,16 @@ myGrid.on('render', function(grid) {
         }\r
         return {x : x, y: y};\r
     },\r
         }\r
         return {x : x, y: y};\r
     },\r
+    \r
+    beforeDestroy : function(){\r
+        this.clearTimers();\r
+        Ext.destroy(this.anchorEl);\r
+        delete this.anchorEl;\r
+        delete this.target;\r
+        delete this.anchorTarget;\r
+        delete this.triggerElement;\r
+        Ext.ToolTip.superclass.beforeDestroy.call(this);    \r
+    },\r
 \r
     // private\r
     onDestroy : function(){\r
 \r
     // private\r
     onDestroy : function(){\r