X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/src/widgets/tree/TreeNodeUI.js
diff --git a/src/widgets/tree/TreeNodeUI.js b/src/widgets/tree/TreeNodeUI.js
index 1be1da66..e1989bf1 100644
--- a/src/widgets/tree/TreeNodeUI.js
+++ b/src/widgets/tree/TreeNodeUI.js
@@ -1,6 +1,6 @@
/*!
- * Ext JS Library 3.0.3
- * 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
*/
@@ -31,7 +31,7 @@ Ext.tree.TreeNodeUI.prototype = {
removeChild : function(node){
if(this.rendered){
this.ctNode.removeChild(node.ui.getEl());
- }
+ }
},
// private
@@ -54,14 +54,14 @@ Ext.tree.TreeNodeUI.prototype = {
// private
onDisableChange : function(node, state){
this.disabled = state;
- if (this.checkbox) {
- this.checkbox.disabled = state;
- }
+ if (this.checkbox) {
+ this.checkbox.disabled = state;
+ }
if(state){
this.addClass("x-tree-node-disabled");
}else{
this.removeClass("x-tree-node-disabled");
- }
+ }
},
// private
@@ -112,7 +112,7 @@ Ext.tree.TreeNodeUI.prototype = {
*/
removeClass : function(cls){
if(this.elNode){
- Ext.fly(this.elNode).removeClass(cls);
+ Ext.fly(this.elNode).removeClass(cls);
}
},
@@ -121,12 +121,12 @@ Ext.tree.TreeNodeUI.prototype = {
if(this.rendered){
this.holder = document.createElement("div");
this.holder.appendChild(this.wrap);
- }
+ }
},
// private
fireEvent : function(){
- return this.node.fireEvent.apply(this.node, arguments);
+ return this.node.fireEvent.apply(this.node, arguments);
},
// private
@@ -134,7 +134,7 @@ Ext.tree.TreeNodeUI.prototype = {
this.node.on("move", this.onMove, this);
if(this.node.disabled){
- this.onDisableChange(this.node, true);
+ this.onDisableChange(this.node, true);
}
if(this.node.hidden){
this.hide();
@@ -172,7 +172,7 @@ Ext.tree.TreeNodeUI.prototype = {
this.node.hidden = false;
if(this.wrap){
this.wrap.style.display = "";
- }
+ }
},
// private
@@ -241,8 +241,8 @@ Ext.tree.TreeNodeUI.prototype = {
// private
onCheckChange : function(){
var checked = this.checkbox.checked;
- // fix for IE6
- this.checkbox.defaultChecked = checked;
+ // fix for IE6
+ this.checkbox.defaultChecked = checked;
this.node.attributes.checked = checked;
this.fireEvent('checkchange', this.node, checked);
},
@@ -258,12 +258,12 @@ Ext.tree.TreeNodeUI.prototype = {
startDrop : function(){
this.dropping = true;
},
-
+
// delayed drop so the click event doesn't get fired on a drop
- endDrop : function(){
+ endDrop : function(){
setTimeout(function(){
this.dropping = false;
- }.createDelegate(this), 50);
+ }.createDelegate(this), 50);
},
// private
@@ -304,7 +304,7 @@ Ext.tree.TreeNodeUI.prototype = {
blur : function(){
try{
this.anchor.blur();
- }catch(e){}
+ }catch(e){}
},
// private
@@ -319,7 +319,7 @@ Ext.tree.TreeNodeUI.prototype = {
}
this.animating = true;
this.updateExpandIcon();
-
+
ct.slideIn('t', {
callback : function(){
this.animating = false;
@@ -366,12 +366,15 @@ Ext.tree.TreeNodeUI.prototype = {
// private
getContainer : function(){
- return this.ctNode;
+ return this.ctNode;
},
- // private
+/**
+ * Returns the element which encapsulates this node.
+ * @return {HtmlElement} The DOM element. The default implementation uses a <li>
.
+ */
getEl : function(){
- return this.wrap;
+ return this.wrap;
},
// private
@@ -386,15 +389,15 @@ Ext.tree.TreeNodeUI.prototype = {
// private
onRender : function(){
- this.render();
+ this.render();
},
// private
render : function(bulkRender){
var n = this.node, a = n.attributes;
- var targetNode = n.parentNode ?
+ var targetNode = n.parentNode ?
n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;
-
+
if(!this.rendered){
this.rendered = true;
@@ -411,7 +414,7 @@ Ext.tree.TreeNodeUI.prototype = {
if(a.qtipTitle){
this.textNode.setAttribute("ext:qtitle", a.qtipTitle);
}
- }
+ }
}else if(a.qtipCfg){
a.qtipCfg.target = Ext.id(this.textNode);
Ext.QuickTips.register(a.qtipCfg);
@@ -432,10 +435,10 @@ Ext.tree.TreeNodeUI.prototype = {
// add some indent caching, this helps performance when rendering a large tree
this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
- var cb = typeof a.checked == 'boolean';
-
- var href = a.href ? a.href : Ext.isGecko ? "" : "#";
- var buf = ['