aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout/bread-crumb.reel
diff options
context:
space:
mode:
authorEric Guzman2012-02-29 16:13:19 -0800
committerEric Guzman2012-02-29 16:13:19 -0800
commit53bdb1e7773069c4cca59e88d6da91cd0f58c94a (patch)
tree44a2147fcbb43ea483f78a1e2e082919f9c81970 /js/components/layout/bread-crumb.reel
parentb2c60efb9c6f5dfa7b0fc5c2b9feebebc805ed97 (diff)
parentb09956e4a9a35c5588cc7cd1f01efb617cbe0884 (diff)
downloadninja-53bdb1e7773069c4cca59e88d6da91cd0f58c94a.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts: js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
Diffstat (limited to 'js/components/layout/bread-crumb.reel')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.css22
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html81
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js74
3 files changed, 72 insertions, 105 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css
index cc984609..67497e10 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.css
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.css
@@ -4,25 +4,17 @@
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6
7.bread_crumb{ 7.breadcrumbTrail{
8 background-color: #282828; 8 background-color: #282828;
9 border-style: double; 9 border-style: double;
10 height: 26px; 10 height: 26px;
11} 11
12.breadcrumbtrail{
13 -webkit-box-flex: 0; 12 -webkit-box-flex: 0;
14} 13}
15.bread_crumb_button{
16 background-color: #575757;
17 float: left;
18 width: 40px;
19 height: 20px;
20 margin-left: 5px;
21 margin-top: 3px;
22 14
23 font-family: 'Droid Sans', sans-serif; 15.breadcrumbTrail button.nj-skinned {
24 font-size: 12px; 16 float: left;
25 text-shadow: 1px 1px 1px black; 17 width: 60px;
18 margin: 2px;
19}
26 20
27 color: white;
28} \ No newline at end of file
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index c1b9ed61..f2368e9a 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -16,55 +16,62 @@
16 "module": "js/components/layout/bread-crumb.reel", 16 "module": "js/components/layout/bread-crumb.reel",
17 "name": "Breadcrumb", 17 "name": "Breadcrumb",
18 "properties": { 18 "properties": {
19 "element": {"#": "breadcrumb_trail"}, 19 "element": {"#": "breadcrumbTrail"},
20 "button" : {"@":"breadCrumbButton"}, 20 "breadcrumbBt": {"@": "breadCrumbButton"}
21 "stylerepetition" : {"@":"repetition1"}
22
23 } 21 }
24 }, 22 },
25 23
26 "breadCrumbButton": { 24 "breadCrumbButton": {
27 "module": "js/components/layout/bread-crumb-button.reel", 25 "module": "montage/ui/button.reel",
28 "name": "BreadcrumbButton", 26 "name": "Button",
29 "properties": { 27 "properties": {
30 "element": {"#": "breadcrumb_button"} 28 "element": {"#": "breadcrumb_button"}
31 }, 29 },
32 "bindings": { 30 "listeners": [
33 "data": { 31 {
34 "boundObject": {"@": "repetition1"}, 32 "type": "action",
35 "boundObjectPropertyPath": "objectAtCurrentIteration", 33 "listener": {"@": "owner"}
36 "oneway": true 34 }
37 } 35 ],
38 } 36 "bindings": {
39 }, 37 "label": {
40 38 "boundObject": {"@": "repetition1"},
41 "repetition1": { 39 "boundObjectPropertyPath": "objectAtCurrentIteration.label",
42 "module": "montage/ui/repetition.reel", 40 "oneway": true
43 "name": "Repetition", 41 },
44 "properties": { 42 "value": {
45 "element": {"#": "breadcrumb_container"} 43 "boundObject": {"@": "repetition1"},
46 }, 44 "boundObjectPropertyPath": "objectAtCurrentIteration.nodeUuid",
47 "bindings": { 45 "oneway": true
48 "objects": { 46 }
49 "boundObject": {"@": "owner"}, 47 }
50 "boundObjectPropertyPath": "containerElements", 48 },
51 "oneway": true
52 }
53 }
54 }
55
56 49
50 "repetition1": {
51 "module": "montage/ui/repetition.reel",
52 "name": "Repetition",
53 "properties": {
54 "element": {"#": "breadcrumb_container"}
55 },
56 "bindings": {
57 "objects": {
58 "boundObject": {"@": "owner"},
59 "boundObjectPropertyPath": "containerElements",
60 "oneway": true
61 }
62 }
63 }
57 } 64 }
58 </script> 65 </script>
59 66
60 </head> 67 </head>
61 <body> 68 <body>
62 69
63 <div id="breadcrumb_trail" class="breadcrumbtrail"> 70 <section id="breadcrumbTrail" class="breadcrumbTrail">
64 <div id="breadcrumb_container" class="bread_crumb"> 71 <div id="breadcrumb_container">
65 <div id="breadcrumb_button"></div> 72 <button id="breadcrumb_button" class="nj-skinned"></button>
66 </div> 73 </div>
67 </div> 74 </section>
68 75
69 </body> 76 </body>
70</html> \ No newline at end of file 77</html> \ No newline at end of file
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index 1824c7c3..b2fa42b1 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -7,7 +7,7 @@
7var Montage = require("montage/core/core").Montage, 7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component; 8 Component = require("montage/ui/component").Component;
9 9
10var Breadcrumb = exports.Breadcrumb = Montage.create(Component, { 10exports.Breadcrumb = Montage.create(Component, {
11 11
12 _container:{ 12 _container:{
13 value:null 13 value:null
@@ -29,23 +29,9 @@ var Breadcrumb = exports.Breadcrumb = Montage.create(Component, {
29 value: [] 29 value: []
30 }, 30 },
31 31
32 32 prepareForDraw: {
33 deserializedFromTemplate : {
34 value: function() { 33 value: function() {
35 this.eventManager.addEventListener( "appLoaded", this, false); 34 this.breadcrumbBt.addEventListener("action", this, false);
36 this.eventManager.addEventListener( "breadCrumbTrail", this, false);
37 }
38 },
39
40 handleAppLoaded : {
41 value: function() {
42
43 Object.defineBinding(this, "container", {
44 boundObject: this.application.ninja,
45 boundObjectPropertyPath: "currentSelectedContainer",
46 oneway: false
47 });
48
49 } 35 }
50 }, 36 },
51 37
@@ -53,56 +39,38 @@ var Breadcrumb = exports.Breadcrumb = Montage.create(Component, {
53 value: function() { 39 value: function() {
54 var parentNode; 40 var parentNode;
55 41
56 this.containerElements.length = 0 42 this.containerElements.length = 0;
57 43
58 if(this.container.id === "UserContent") { 44 parentNode = this.container;
59 this.containerElements.push({selected:false, element:this.container});
60 } else {
61 parentNode = this.container;
62 45
63 while(parentNode.id!=="UserContent") { 46 while(parentNode.id !== "UserContent") {
64 this.containerElements.unshift({selected:false,element:parentNode}); 47 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
65 parentNode = parentNode.parentNode; 48 parentNode = parentNode.parentNode;
66 }
67
68 this.containerElements.unshift({selected:false,element:parentNode});
69 } 49 }
70 50
71 NJevent('layerBinding',{selected:false ,element:this.container}) 51 // This is always the top container which is now hardcoded to body
52 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentN