diff options
author | Jonathan Duran | 2012-02-06 20:49:42 -0800 |
---|---|---|
committer | Jonathan Duran | 2012-02-06 20:49:42 -0800 |
commit | d34f745c3b3d88679512ca7d9e4112f109cb31d0 (patch) | |
tree | db630907f144cdceb2d1856e88e4da05fb3eeabc /js/components/treeview/ninja-leaf.reel/ninja-leaf.js | |
parent | 7e83bb2ac681eb1340dea0f6efaaddfcf0f2b52a (diff) | |
parent | 8950b342d1eda8bfa195372e1c17363a409651cd (diff) | |
download | ninja-d34f745c3b3d88679512ca7d9e4112f109cb31d0.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Timeline
Diffstat (limited to 'js/components/treeview/ninja-leaf.reel/ninja-leaf.js')
-rw-r--r-- | js/components/treeview/ninja-leaf.reel/ninja-leaf.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js new file mode 100644 index 00000000..bd566b26 --- /dev/null +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js | |||
@@ -0,0 +1,41 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | TreeNode = require("js/components/treeview/tree-node").TreeNode; | ||
10 | |||
11 | exports.Leaf = Montage.create(TreeNode, { | ||
12 | hasTemplate: { | ||
13 | value: true | ||
14 | }, | ||
15 | templateDidLoad : { | ||
16 | value: function() { | ||
17 | this.needsDraw = true; | ||
18 | } | ||
19 | }, | ||
20 | prepareForDraw: { | ||
21 | value : function() { | ||
22 | this.activationEvent = this.activationEvent || 'click'; | ||
23 | this.label._element.addEventListener(this.activationEvent, this.handleNodeActivation.bind(this), false); | ||
24 | } | ||
25 | }, | ||
26 | handleNodeActivation: { | ||
27 | value: function(e) { | ||
28 | console.log(this.sourceObject); | ||
29 | this.treeView.contentController.delegate.applyPresetSelection(this.sourceObject); | ||
30 | } | ||
31 | }, | ||
32 | draw : { | ||
33 | value : function() { | ||
34 | if(this.sourceObject[this.labelKey]) { | ||
35 | this._labelText = this.sourceObject[this.labelKey]; | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | |||
40 | |||
41 | }); | ||