aboutsummaryrefslogtreecommitdiff
path: root/js/components/treeview
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-14 11:13:32 -0800
committerValerio Virgillito2012-02-14 11:13:32 -0800
commitdf898049b2990f456a305eb18434b887468225cf (patch)
tree487d3bcf53c9769545b1310f5d7b50bd06dc2329 /js/components/treeview
parent0eb739ab722ea768ab0fa1c5de0ee09ed1a576ea (diff)
downloadninja-df898049b2990f456a305eb18434b887468225cf.tar.gz
small changes to the tree component to allow events to be passed and add a double click handler
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components/treeview')
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.js7
1 files changed, 4 insertions, 3 deletions
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, {
36 handleEvent : { 36 handleEvent : {
37 value: function(e) { 37 value: function(e) {
38 var delegateMethod = this.delegateEventMap[e._event.type]; 38 var delegateMethod = this.delegateEventMap[e._event.type];
39 this.callDelegateMethod(delegateMethod); 39 this.callDelegateMethod(delegateMethod, e);
40 } 40 }
41 }, 41 },
42 callDelegateMethod : { 42 callDelegateMethod : {
43 value: function(methodName) { 43 value: function(methodName, evt) {
44 var delegate = this.treeView.contentController.delegate; 44 var delegate = this.treeView.contentController.delegate;
45 if(delegate && typeof delegate[methodName] === 'function') { 45 if(delegate && typeof delegate[methodName] === 'function') {
46 delegate[methodName](this.sourceObject); 46 delegate[methodName](this.sourceObject, evt);
47 } 47 }
48 } 48 }
49 }, 49 },
@@ -60,6 +60,7 @@ exports.Leaf = Montage.create(TreeNode, {
60 delegateEventMap : { 60 delegateEventMap : {
61 value: { 61 value: {
62 'click' : 'handleNodeActivation', 62 'click' : 'handleNodeActivation',
63 'dblclick' : 'handleDblclick',
63 'dragstart' : 'handleDragStart', 64 'dragstart' : 'handleDragStart',
64 'dragend' : 'handleDragEnd' 65 'dragend' : 'handleDragEnd'
65 } 66 }