Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / TreeEventModel.html
index a754fdc..5d695ee 100644 (file)
@@ -14,7 +14,7 @@
 Ext.tree.TreeEventModel.prototype = {\r
     initEvents : function(){\r
         var t = this.tree;\r
-            \r
+\r
         if(t.trackMouseOver !== false){\r
             t.mon(t.innerCt, {\r
                 scope: this,\r
@@ -87,12 +87,15 @@ Ext.tree.TreeEventModel.prototype = {
     },\r
 \r
     trackExit : function(e){\r
-        if(this.lastOverNode && !e.within(this.lastOverNode.ui.getEl())){\r
-            this.onNodeOut(e, this.lastOverNode);\r
+        if(this.lastOverNode){\r
+            if(this.lastOverNode.ui && !e.within(this.lastOverNode.ui.getEl())){\r
+                this.onNodeOut(e, this.lastOverNode);\r
+            }\r
             delete this.lastOverNode;\r
             Ext.getBody().un('mouseover', this.trackExit, this);\r
             this.trackingDoc = false;\r
         }\r
+\r
     },\r
 \r
     delegateClick : function(e, t){\r
@@ -114,7 +117,7 @@ Ext.tree.TreeEventModel.prototype = {
             if(this.getNodeTarget(e)){\r
                 this.onNodeDblClick(e, this.getNode(e));\r
             }else{\r
-                this.onContainerEvent(e, 'dblclick');    \r
+                this.onContainerEvent(e, 'dblclick');\r
             }\r
         }\r
     },\r
@@ -124,13 +127,13 @@ Ext.tree.TreeEventModel.prototype = {
             if(this.getNodeTarget(e)){\r
                 this.onNodeContextMenu(e, this.getNode(e));\r
             }else{\r
-                this.onContainerEvent(e, 'contextmenu');    \r
+                this.onContainerEvent(e, 'contextmenu');\r
             }\r
         }\r
     },\r
-    \r
+\r
     onContainerEvent: function(e, type){\r
-        this.tree.fireEvent('container' + type, this.tree, e); \r
+        this.tree.fireEvent('container' + type, this.tree, e);\r
     },\r
 \r
     onNodeClick : function(e, node){\r
@@ -171,7 +174,8 @@ Ext.tree.TreeEventModel.prototype = {
     },\r
 \r
     beforeEvent : function(e){\r
-        if(this.disabled){\r
+        var node = this.getNode(e);\r
+        if(this.disabled || !node || !node.ui){\r
             e.stopEvent();\r
             return false;\r
         }\r