From df898049b2990f456a305eb18434b887468225cf Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 14 Feb 2012 11:13:32 -0800 Subject: small changes to the tree component to allow events to be passed and add a double click handler Signed-off-by: Valerio Virgillito --- js/components/treeview/ninja-leaf.reel/ninja-leaf.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/components/treeview') diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js index 0b7a171e..c6416693 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js @@ -36,14 +36,14 @@ exports.Leaf = Montage.create(TreeNode, { handleEvent : { value: function(e) { var delegateMethod = this.delegateEventMap[e._event.type]; - this.callDelegateMethod(delegateMethod); + this.callDelegateMethod(delegateMethod, e); } }, callDelegateMethod : { - value: function(methodName) { + value: function(methodName, evt) { var delegate = this.treeView.contentController.delegate; if(delegate && typeof delegate[methodName] === 'function') { - delegate[methodName](this.sourceObject); + delegate[methodName](this.sourceObject, evt); } } }, @@ -60,6 +60,7 @@ exports.Leaf = Montage.create(TreeNode, { delegateEventMap : { value: { 'click' : 'handleNodeActivation', + 'dblclick' : 'handleDblclick', 'dragstart' : 'handleDragStart', 'dragend' : 'handleDragEnd' } -- cgit v1.2.3