-<html>
-<head>
- <title>The source code</title>
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body onload="prettyPrint();">
- <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-Ext.tree.TreeEventModel = function(tree){\r
+<html>\r
+<head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \r
+ <title>The source code</title>\r
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body onload="prettyPrint();">\r
+ <pre class="prettyprint lang-js">Ext.tree.TreeEventModel = function(tree){\r
this.tree = tree;\r
this.tree.on('render', this.initEvents, this);\r
}\r
},\r
\r
delegateClick : function(e, t){\r
- if(!this.beforeEvent(e)){\r
- return;\r
- }\r
-\r
- if(e.getTarget('input[type=checkbox]', 1)){\r
- this.onCheckboxClick(e, this.getNode(e));\r
- }\r
- else if(e.getTarget('.x-tree-ec-icon', 1)){\r
- this.onIconClick(e, this.getNode(e));\r
- }\r
- else if(this.getNodeTarget(e)){\r
- this.onNodeClick(e, this.getNode(e));\r
+ if(this.beforeEvent(e)){\r
+ if(e.getTarget('input[type=checkbox]', 1)){\r
+ this.onCheckboxClick(e, this.getNode(e));\r
+ }else if(e.getTarget('.x-tree-ec-icon', 1)){\r
+ this.onIconClick(e, this.getNode(e));\r
+ }else if(this.getNodeTarget(e)){\r
+ this.onNodeClick(e, this.getNode(e));\r
+ }else{\r
+ this.onContainerEvent(e, 'click');\r
+ }\r
}\r
},\r
\r
delegateDblClick : function(e, t){\r
- if(this.beforeEvent(e) && this.getNodeTarget(e)){\r
- this.onNodeDblClick(e, this.getNode(e));\r
+ if(this.beforeEvent(e)){\r
+ if(this.getNodeTarget(e)){\r
+ this.onNodeDblClick(e, this.getNode(e));\r
+ }else{\r
+ this.onContainerEvent(e, 'dblclick'); \r
+ }\r
}\r
},\r
\r
delegateContextMenu : function(e, t){\r
- if(this.beforeEvent(e) && this.getNodeTarget(e)){\r
- this.onNodeContextMenu(e, this.getNode(e));\r
+ if(this.beforeEvent(e)){\r
+ if(this.getNodeTarget(e)){\r
+ this.onNodeContextMenu(e, this.getNode(e));\r
+ }else{\r
+ this.onContainerEvent(e, 'contextmenu'); \r
+ }\r
}\r
},\r
+ \r
+ onContainerEvent: function(e, type){\r
+ this.tree.fireEvent('container' + type, this.tree, e); \r
+ },\r
\r
onNodeClick : function(e, node){\r
node.ui.onClick(e);\r
enable: function(){\r
this.disabled = false;\r
}\r
-};</pre>
-</body>
+};</pre> \r
+</body>\r
</html>
\ No newline at end of file