aboutsummaryrefslogtreecommitdiff
path: root/js/components/treeview/leaf.reel
diff options
context:
space:
mode:
authorArmen Kesablyan2012-02-07 16:55:34 -0800
committerArmen Kesablyan2012-02-07 16:55:34 -0800
commit10f0ad4c15f090b2d0d50d11e4c7aaf291e9eb0e (patch)
tree12b31910a3c7c7fa2ee0b26d8aaa611710e139a5 /js/components/treeview/leaf.reel
parent7f8730c3add146f1ba107e6fc22d1f5a8348ed8b (diff)
parent668510892537eaaeb2e11520831d87b44b2489b7 (diff)
downloadninja-10f0ad4c15f090b2d0d50d11e4c7aaf291e9eb0e.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into text-tool
Conflicts: _scss/compass_app_log.txt css/ninja.css
Diffstat (limited to 'js/components/treeview/leaf.reel')
-rw-r--r--js/components/treeview/leaf.reel/leaf.css10
-rw-r--r--js/components/treeview/leaf.reel/leaf.html43
-rw-r--r--js/components/treeview/leaf.reel/leaf.js44
3 files changed, 97 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..41fb02ff
--- /dev/null
+++ b/js/components/treeview/leaf.reel/leaf.css
@@ -0,0 +1,10 @@
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.leaf > .leaf-label {
8 opacity: 0.8;
9 cursor: pointer;
10} \ 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..cf0b4e40
--- /dev/null
+++ b/js/components/treeview/leaf.reel/leaf.html
@@ -0,0 +1,43 @@
1<!DOCTYPE html>
2<!-- <copyright>
3This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6</copyright> -->
7<html lang="en">
8<head>
9 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <link href="leaf.css" rel="stylesheet" type="text/css" />
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/components/treeview/leaf.reel",
15 "name" : "Leaf",
16 "properties" : {
17 "element" : {"#" : "leaf"},
18 "label" : { "@" : "textComponent" }
19 }
20 },
21 "textComponent" : {
22 "module" : "montage/ui/dynamic-text.reel",
23 "name" : "DynamicText",
24 "properties" : {
25 "element" : { "#" : "label" }
26 },
27 "bindings" : {
28 "value" : {
29 "boundObject" : {"@": "owner"},
30 "boundObjectPropertyPath": "_labelText",
31 "oneway": true
32 }
33 }
34 }
35 }
36 </script>
37</head>
38<body>
39 <div id="leaf" class="leaf">
40 <span id="label" class="leaf-label"></span>
41 </div>
42</body>
43</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});