Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / src / widgets / tree / TreeNodeUI.js
index 46ba4ef..e1989bf 100644 (file)
@@ -1,6 +1,6 @@
 /*!
 /*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
+ * Ext JS Library 3.1.1
+ * Copyright(c) 2006-2010 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
  * licensing@extjs.com
  * http://www.extjs.com/license
  */
@@ -31,7 +31,7 @@ Ext.tree.TreeNodeUI.prototype = {
     removeChild : function(node){\r
         if(this.rendered){\r
             this.ctNode.removeChild(node.ui.getEl());\r
     removeChild : function(node){\r
         if(this.rendered){\r
             this.ctNode.removeChild(node.ui.getEl());\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -56,12 +56,12 @@ Ext.tree.TreeNodeUI.prototype = {
         this.disabled = state;\r
         if (this.checkbox) {\r
             this.checkbox.disabled = state;\r
         this.disabled = state;\r
         if (this.checkbox) {\r
             this.checkbox.disabled = state;\r
-        }        \r
+        }\r
         if(state){\r
             this.addClass("x-tree-node-disabled");\r
         }else{\r
             this.removeClass("x-tree-node-disabled");\r
         if(state){\r
             this.addClass("x-tree-node-disabled");\r
         }else{\r
             this.removeClass("x-tree-node-disabled");\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -112,7 +112,7 @@ Ext.tree.TreeNodeUI.prototype = {
  */\r
     removeClass : function(cls){\r
         if(this.elNode){\r
  */\r
     removeClass : function(cls){\r
         if(this.elNode){\r
-            Ext.fly(this.elNode).removeClass(cls);  \r
+            Ext.fly(this.elNode).removeClass(cls);\r
         }\r
     },\r
 \r
         }\r
     },\r
 \r
@@ -121,12 +121,12 @@ Ext.tree.TreeNodeUI.prototype = {
         if(this.rendered){\r
             this.holder = document.createElement("div");\r
             this.holder.appendChild(this.wrap);\r
         if(this.rendered){\r
             this.holder = document.createElement("div");\r
             this.holder.appendChild(this.wrap);\r
-        }  \r
+        }\r
     },\r
 \r
     // private\r
     fireEvent : function(){\r
     },\r
 \r
     // private\r
     fireEvent : function(){\r
-        return this.node.fireEvent.apply(this.node, arguments);  \r
+        return this.node.fireEvent.apply(this.node, arguments);\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -134,7 +134,7 @@ Ext.tree.TreeNodeUI.prototype = {
         this.node.on("move", this.onMove, this);\r
 \r
         if(this.node.disabled){\r
         this.node.on("move", this.onMove, this);\r
 \r
         if(this.node.disabled){\r
-            this.onDisableChange(this.node, true);            \r
+            this.onDisableChange(this.node, true);\r
         }\r
         if(this.node.hidden){\r
             this.hide();\r
         }\r
         if(this.node.hidden){\r
             this.hide();\r
@@ -172,7 +172,7 @@ Ext.tree.TreeNodeUI.prototype = {
         this.node.hidden = false;\r
         if(this.wrap){\r
             this.wrap.style.display = "";\r
         this.node.hidden = false;\r
         if(this.wrap){\r
             this.wrap.style.display = "";\r
-        } \r
+        }\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -242,7 +242,7 @@ Ext.tree.TreeNodeUI.prototype = {
     onCheckChange : function(){\r
         var checked = this.checkbox.checked;\r
         // fix for IE6\r
     onCheckChange : function(){\r
         var checked = this.checkbox.checked;\r
         // fix for IE6\r
-        this.checkbox.defaultChecked = checked;        \r
+        this.checkbox.defaultChecked = checked;\r
         this.node.attributes.checked = checked;\r
         this.fireEvent('checkchange', this.node, checked);\r
     },\r
         this.node.attributes.checked = checked;\r
         this.fireEvent('checkchange', this.node, checked);\r
     },\r
@@ -258,12 +258,12 @@ Ext.tree.TreeNodeUI.prototype = {
     startDrop : function(){\r
         this.dropping = true;\r
     },\r
     startDrop : function(){\r
         this.dropping = true;\r
     },\r
-    \r
+\r
     // delayed drop so the click event doesn't get fired on a drop\r
     // delayed drop so the click event doesn't get fired on a drop\r
-    endDrop : function(){ \r
+    endDrop : function(){\r
        setTimeout(function(){\r
            this.dropping = false;\r
        setTimeout(function(){\r
            this.dropping = false;\r
-       }.createDelegate(this), 50); \r
+       }.createDelegate(this), 50);\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -304,7 +304,7 @@ Ext.tree.TreeNodeUI.prototype = {
     blur : function(){\r
         try{\r
             this.anchor.blur();\r
     blur : function(){\r
         try{\r
             this.anchor.blur();\r
-        }catch(e){} \r
+        }catch(e){}\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -319,7 +319,7 @@ Ext.tree.TreeNodeUI.prototype = {
         }\r
         this.animating = true;\r
         this.updateExpandIcon();\r
         }\r
         this.animating = true;\r
         this.updateExpandIcon();\r
-        \r
+\r
         ct.slideIn('t', {\r
            callback : function(){\r
                this.animating = false;\r
         ct.slideIn('t', {\r
            callback : function(){\r
                this.animating = false;\r
@@ -366,7 +366,7 @@ Ext.tree.TreeNodeUI.prototype = {
 \r
     // private\r
     getContainer : function(){\r
 \r
     // private\r
     getContainer : function(){\r
-        return this.ctNode;  \r
+        return this.ctNode;\r
     },\r
 \r
 /**\r
     },\r
 \r
 /**\r
@@ -374,7 +374,7 @@ Ext.tree.TreeNodeUI.prototype = {
  * @return {HtmlElement} The DOM element. The default implementation uses a <code>&lt;li></code>.\r
  */\r
     getEl : function(){\r
  * @return {HtmlElement} The DOM element. The default implementation uses a <code>&lt;li></code>.\r
  */\r
     getEl : function(){\r
-        return this.wrap;  \r
+        return this.wrap;\r
     },\r
 \r
     // private\r
     },\r
 \r
     // private\r
@@ -389,15 +389,15 @@ Ext.tree.TreeNodeUI.prototype = {
 \r
     // private\r
     onRender : function(){\r
 \r
     // private\r
     onRender : function(){\r
-        this.render();    \r
+        this.render();\r
     },\r
 \r
     // private\r
     render : function(bulkRender){\r
         var n = this.node, a = n.attributes;\r
     },\r
 \r
     // private\r
     render : function(bulkRender){\r
         var n = this.node, a = n.attributes;\r
-        var targetNode = n.parentNode ? \r
+        var targetNode = n.parentNode ?\r
               n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;\r
               n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;\r
-        \r
+\r
         if(!this.rendered){\r
             this.rendered = true;\r
 \r
         if(!this.rendered){\r
             this.rendered = true;\r
 \r
@@ -414,7 +414,7 @@ Ext.tree.TreeNodeUI.prototype = {
                    if(a.qtipTitle){\r
                        this.textNode.setAttribute("ext:qtitle", a.qtipTitle);\r
                    }\r
                    if(a.qtipTitle){\r
                        this.textNode.setAttribute("ext:qtitle", a.qtipTitle);\r
                    }\r
-               } \r
+               }\r
             }else if(a.qtipCfg){\r
                 a.qtipCfg.target = Ext.id(this.textNode);\r
                 Ext.QuickTips.register(a.qtipCfg);\r
             }else if(a.qtipCfg){\r
                 a.qtipCfg.target = Ext.id(this.textNode);\r
                 Ext.QuickTips.register(a.qtipCfg);\r
@@ -453,7 +453,7 @@ Ext.tree.TreeNodeUI.prototype = {
         }else{\r
             this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf);\r
         }\r
         }else{\r
             this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf);\r
         }\r
-        \r
+\r
         this.elNode = this.wrap.childNodes[0];\r
         this.ctNode = this.wrap.childNodes[1];\r
         var cs = this.elNode.childNodes;\r
         this.elNode = this.wrap.childNodes[0];\r
         this.ctNode = this.wrap.childNodes[1];\r
         var cs = this.elNode.childNodes;\r
@@ -478,7 +478,7 @@ Ext.tree.TreeNodeUI.prototype = {
     getAnchor : function(){\r
         return this.anchor;\r
     },\r
     getAnchor : function(){\r
         return this.anchor;\r
     },\r
-    \r
+\r
 /**\r
  * Returns the text node.\r
  * @return {HtmlNode} The DOM text node.\r
 /**\r
  * Returns the text node.\r
  * @return {HtmlNode} The DOM text node.\r
@@ -486,7 +486,7 @@ Ext.tree.TreeNodeUI.prototype = {
     getTextEl : function(){\r
         return this.textNode;\r
     },\r
     getTextEl : function(){\r
         return this.textNode;\r
     },\r
-    \r
+\r
 /**\r
  * Returns the icon &lt;img> element.\r
  * @return {HtmlElement} The DOM image element.\r
 /**\r
  * Returns the icon &lt;img> element.\r
  * @return {HtmlElement} The DOM image element.\r
@@ -501,14 +501,14 @@ Ext.tree.TreeNodeUI.prototype = {
  * @return {Boolean} The checked flag.\r
  */\r
     isChecked : function(){\r
  * @return {Boolean} The checked flag.\r
  */\r
     isChecked : function(){\r
-        return this.checkbox ? this.checkbox.checked : false; \r
+        return this.checkbox ? this.checkbox.checked : false;\r
     },\r
 \r
     // private\r
     updateExpandIcon : function(){\r
         if(this.rendered){\r
     },\r
 \r
     // private\r
     updateExpandIcon : function(){\r
         if(this.rendered){\r
-            var n = this.node, \r
-                c1, \r
+            var n = this.node,\r
+                c1,\r
                 c2,\r
                 cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow",\r
                 hasChild = n.hasChildNodes();\r
                 c2,\r
                 cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow",\r
                 hasChild = n.hasChildNodes();\r
@@ -532,7 +532,7 @@ Ext.tree.TreeNodeUI.prototype = {
                 }\r
             }else{\r
                 if(!this.wasLeaf){\r
                 }\r
             }else{\r
                 if(!this.wasLeaf){\r
-                    Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-leaf");\r
+                    Ext.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-collapsed");\r
                     delete this.c1;\r
                     delete this.c2;\r
                     this.wasLeaf = true;\r
                     delete this.c1;\r
                     delete this.c2;\r
                     this.wasLeaf = true;\r
@@ -545,7 +545,7 @@ Ext.tree.TreeNodeUI.prototype = {
             }\r
         }\r
     },\r
             }\r
         }\r
     },\r
-    \r
+\r
     // private\r
     onIdChange: function(id){\r
         if(this.rendered){\r
     // private\r
     onIdChange: function(id){\r
         if(this.rendered){\r
@@ -593,7 +593,7 @@ Ext.tree.TreeNodeUI.prototype = {
         if(this.elNode){\r
             Ext.dd.Registry.unregister(this.elNode.id);\r
         }\r
         if(this.elNode){\r
             Ext.dd.Registry.unregister(this.elNode.id);\r
         }\r
-        \r
+\r
         Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){\r
             if(this[el]){\r
                 Ext.fly(this[el]).remove();\r
         Ext.each(['textnode', 'anchor', 'checkbox', 'indentNode', 'ecNode', 'iconNode', 'elNode', 'ctNode', 'wrap', 'holder'], function(el){\r
             if(this[el]){\r
                 Ext.fly(this[el]).remove();\r