aboutsummaryrefslogtreecommitdiff
path: root/js/components/treeview/leaf.reel
diff options
context:
space:
mode:
authorJonathan Duran2012-02-06 20:49:42 -0800
committerJonathan Duran2012-02-06 20:49:42 -0800
commitd34f745c3b3d88679512ca7d9e4112f109cb31d0 (patch)
treedb630907f144cdceb2d1856e88e4da05fb3eeabc /js/components/treeview/leaf.reel
parent7e83bb2ac681eb1340dea0f6efaaddfcf0f2b52a (diff)
parent8950b342d1eda8bfa195372e1c17363a409651cd (diff)
downloadninja-d34f745c3b3d88679512ca7d9e4112f109cb31d0.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Timeline
Diffstat (limited to 'js/components/treeview/leaf.reel')
-rw-r--r--js/components/treeview/leaf.reel/leaf.css4
-rw-r--r--js/components/treeview/leaf.reel/leaf.html38
-rw-r--r--js/components/treeview/leaf.reel/leaf.js44
3 files changed, 86 insertions, 0 deletions
diff --git a/js/components/treeview/leaf.reel/leaf.css b/js/components/treeview/leaf.reel/leaf.css
new file mode 100644
index 00000000..fea5a2c4
--- /dev/null
+++ b/js/components/treeview/leaf.reel/leaf.css
@@ -0,0 +1,4 @@
1.leaf > .leaf-label {
2 opacity: 0.8;
3 cursor: pointer;
4} \ No newline at end of file
diff --git a/js/components/treeview/leaf.reel/leaf.html b/js/components/treeview/leaf.reel/leaf.html
new file mode 100644
index 00000000..991a4323
--- /dev/null
+++ b/js/components/treeview/leaf.reel/leaf.html
@@ -0,0 +1,38 @@
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <link href="leaf.css" rel="stylesheet" type="text/css" />
6 <script type="text/montage-serialization">
7 {
8 "owner": {
9 "module" : "js/components/treeview/leaf.reel",
10 "name" : "Leaf",
11 "properties" : {
12 "element" : {"#" : "leaf"},
13 "label" : { "@" : "textComponent" }
14 }
15 },
16 "textComponent" : {
17 "module" : "montage/ui/dynamic-text.reel",
18 "name" : "DynamicText",
19 "properties" : {
20 "element" : { "#" : "label" }
21 },
22 "bindings" : {
23 "value" : {
24 "boundObject" : {"@": "owner"},
25 "boundObjectPropertyPath": "_labelText",
26 "oneway": true
27 }
28 }
29 }
30 }
31 </script>
32</head>
33<body>
34 <div id="leaf" class="leaf">
35 <span id="label" class="leaf-label"></span>
36 </div>
37</body>
38</html> \ No newline at end of file
diff --git a/js/components/treeview/leaf.reel/leaf.js b/js/components/treeview/leaf.reel/leaf.js
new file mode 100644
index 00000000..3a63f5ed
--- /dev/null
+++ b/js/components/treeview/leaf.reel/leaf.js
@@ -0,0 +1,44 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9 TreeNode = require("js/components/treeview/tree-node").TreeNode;
10
11exports.Leaf = Montage.create(TreeNode, {
12 hasTemplate: {
13 value: true
14 },
15 deserializedFromTemplate : {
16 value: function() {
17 //console.log('Leaf deserialized.');
18 }
19 },
20 templateDidLoad : {
21 value: function() {
22 //debugger;
23 console.log('Leaf\'s template did load.');
24 this.needsDraw = true;
25 }
26 },
27 prepareForDraw: {
28 value : function() {
29 console.log('Leafs prepare for draw.', this.labelKey);
30 }
31 },
32 draw : {
33 value : function() {
34 if(this.sourceObject[this.labelKey]) {
35 this._labelText = this.sourceObject[this.labelKey];
36 } else {
37 console.log("Label key unknown");
38 }
39
40 }
41 }
42
43
44});