X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/TreeEventModel.html
diff --git a/docs/source/TreeEventModel.html b/docs/source/TreeEventModel.html
index 5a432dd4..a754fdc9 100644
--- a/docs/source/TreeEventModel.html
+++ b/docs/source/TreeEventModel.html
@@ -1,5 +1,6 @@
+
The source code
@@ -12,14 +13,21 @@
Ext.tree.TreeEventModel.prototype = {
initEvents : function(){
- var el = this.tree.getTreeEl();
- el.on('click', this.delegateClick, this);
- if(this.tree.trackMouseOver !== false){
- this.tree.innerCt.on('mouseover', this.delegateOver, this);
- this.tree.innerCt.on('mouseout', this.delegateOut, this);
- }
- el.on('dblclick', this.delegateDblClick, this);
- el.on('contextmenu', this.delegateContextMenu, this);
+ var t = this.tree;
+
+ if(t.trackMouseOver !== false){
+ t.mon(t.innerCt, {
+ scope: this,
+ mouseover: this.delegateOver,
+ mouseout: this.delegateOut
+ });
+ }
+ t.mon(t.getTreeEl(), {
+ scope: this,
+ click: this.delegateClick,
+ dblclick: this.delegateDblClick,
+ contextmenu: this.delegateContextMenu
+ });
},
getNode : function(e){
@@ -88,32 +96,42 @@ Ext.tree.TreeEventModel.prototype = {
},
delegateClick : function(e, t){
- if(!this.beforeEvent(e)){
- return;
- }
-
- if(e.getTarget('input[type=checkbox]', 1)){
- this.onCheckboxClick(e, this.getNode(e));
- }
- else if(e.getTarget('.x-tree-ec-icon', 1)){
- this.onIconClick(e, this.getNode(e));
- }
- else if(this.getNodeTarget(e)){
- this.onNodeClick(e, this.getNode(e));
+ if(this.beforeEvent(e)){
+ if(e.getTarget('input[type=checkbox]', 1)){
+ this.onCheckboxClick(e, this.getNode(e));
+ }else if(e.getTarget('.x-tree-ec-icon', 1)){
+ this.onIconClick(e, this.getNode(e));
+ }else if(this.getNodeTarget(e)){
+ this.onNodeClick(e, this.getNode(e));
+ }else{
+ this.onContainerEvent(e, 'click');
+ }
}
},
delegateDblClick : function(e, t){
- if(this.beforeEvent(e) && this.getNodeTarget(e)){
- this.onNodeDblClick(e, this.getNode(e));
+ if(this.beforeEvent(e)){
+ if(this.getNodeTarget(e)){
+ this.onNodeDblClick(e, this.getNode(e));
+ }else{
+ this.onContainerEvent(e, 'dblclick');
+ }
}
},
delegateContextMenu : function(e, t){
- if(this.beforeEvent(e) && this.getNodeTarget(e)){
- this.onNodeContextMenu(e, this.getNode(e));
+ if(this.beforeEvent(e)){
+ if(this.getNodeTarget(e)){
+ this.onNodeContextMenu(e, this.getNode(e));
+ }else{
+ this.onContainerEvent(e, 'contextmenu');
+ }
}
},
+
+ onContainerEvent: function(e, type){
+ this.tree.fireEvent('container' + type, this.tree, e);
+ },
onNodeClick : function(e, node){
node.ui.onClick(e);