aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorAnanya Sen2012-05-18 16:57:27 -0700
committerAnanya Sen2012-05-18 16:57:27 -0700
commitbddbcd15c165ac0731de204b023a1e60d71b5d79 (patch)
tree727997cc71d5e9c951c1089dfbdeb90cd3b68e6f /js/components
parent7a22f7b368ef549a5b30c58a0f3900685b764bdb (diff)
parente7c288fe8f5d3a9e5c9f0eb0a045c6c195a0e7b8 (diff)
downloadninja-bddbcd15c165ac0731de204b023a1e60d71b5d79.tar.gz
Merge branch 'refs/heads/master-dom-architecture' into dom-architecture
Diffstat (limited to 'js/components')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html37
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js24
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js4
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.html4
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.js11
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.html12
-rwxr-xr-xjs/components/tools-properties/rect-properties.reel/rect-properties.html46
-rwxr-xr-xjs/components/tools-properties/rect-properties.reel/rect-properties.js79
-rwxr-xr-xjs/components/ui/color-chip.reel/color-chip.js13
9 files changed, 110 insertions, 120 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index ae3e2022..0dabc781 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -32,30 +32,23 @@
32 } 32 }
33 ], 33 ],
34 "bindings": { 34 "bindings": {
35 "label": { 35 "label": {"<-": "@buttonsList.objectAtCurrentIteration.label"},
36 "boundObject": {"@": "repetition1"}, 36 "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"}
37 "boundObjectPropertyPath": "objectAtCurrentIteration.label", 37 }
38 "oneway": true 38 },
39 }, 39
40 "value": { 40 "buttonsListController": {
41 "boundObject": {"@": "repetition1"}, 41 "prototype": "montage/ui/controller/array-controller",
42 "boundObjectPropertyPath": "objectAtCurrentIteration.nodeUuid", 42 "bindings": {
43 "oneway": true 43 "content": {"<<->": "@owner.containerElements"}
44 }
45 } 44 }
46 }, 45 },
47 46
48 "repetition1": { 47 "buttonsList": {
49 "prototype": "montage/ui/repetition.reel", 48 "prototype": "montage/ui/repetition.reel",
50 "properties": { 49 "properties": {
51 "element": {"#": "breadcrumb_container"} 50 "element": {"#": "breadcrumb_container"},
52 }, 51 "contentController": {"@": "buttonsListController"}
53 "bindings": {
54 "objects": {
55 "boundObject": {"@": "owner"},
56 "boundObjectPropertyPath": "containerElements",
57 "oneway": true
58 }
59 } 52 }
60 }, 53 },
61 54
@@ -65,11 +58,7 @@
65 "element": {"#": "disabledCondition"} 58 "element": {"#": "disabledCondition"}
66 }, 59 },
67 "bindings": { 60 "bindings": {
68 "condition": { 61 "condition": {"<-": "@owner.disabled"}
69 "boundObject": {"@": "owner"},
70 "boundObjectPropertyPath": "disabled",
71 "oneway": true
72 }
73 } 62 }
74 } 63 }
75 } 64 }
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index c1b021a3..d2a6b1e4 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -60,30 +60,18 @@ exports.Breadcrumb = Montage.create(Component, {
60 value: function() { 60 value: function() {
61 var parentNode; 61 var parentNode;
62 62
63 this.containerElements.length = 0; 63// delete this.containerElements;
64 this.containerElements = [];
64 65
65 parentNode = this.container; 66 parentNode = this.container;
66 67
67 // This is for the old template support. 68 while(parentNode !== this.application.ninja.currentDocument.documentRoot) {
68 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
69 if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") {
70 while(parentNode.id !== "UserContent") {
71 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
72 parentNode = parentNode.parentNode;
73 }
74
75 // This is always the top container which is now hardcoded to body
76 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"});
77 } else {
78 while(parentNode !== this.application.ninja.currentDocument.documentRoot) {
79 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
80 parentNode = parentNode.parentNode;
81 }
82
83 // This is always the top container which is now hardcoded to body
84 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); 69 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
70 parentNode = parentNode.parentNode;
85 } 71 }
86 72
73 // This is always the top container which is now hardcoded to body
74 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
87 } 75 }
88 }, 76 },
89 77
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index ad0236c6..50b3624c 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -121,8 +121,8 @@ exports.DocumentEntry = Montage.create(Component, {
121 if(event._event.target.nodeName === "IMG") { 121 if(event._event.target.nodeName === "IMG") {
122 this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 122 this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
123 } else { 123 } else {
124 if(!this._document.isActive) { 124 if(!this.active) {
125 this.application.ninja.stage.stageView.switchDocument(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 125 this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid));
126 } 126 }
127 } 127 }
128 } 128 }
diff --git a/js/components/layout/tool-button.reel/tool-button.html b/js/components/layout/tool-button.reel/tool-button.html
index 84a6d34e..a329f646 100755
--- a/js/components/layout/tool-button.reel/tool-button.html
+++ b/js/components/layout/tool-button.reel/tool-button.html
@@ -16,6 +16,10 @@
16 "prototype": "js/components/layout/tool-button.reel", 16 "prototype": "js/components/layout/tool-button.reel",
17 "properties": { 17 "properties": {
18 "element": {"#": "toolBarButton"} 18 "element": {"#": "toolBarButton"}
19 },
20 "bindings": {
21 "selected": {"<<->": "@owner.data.selected"},
22 "subselected": {"<-": "@owner.data.subtools.selected"}
19 } 23 }
20 } 24 }
21 } 25 }
diff --git a/js/components/layout/tool-button.reel/tool-button.js b/js/components/layout/tool-button.reel/tool-button.js
index 6cea0dc3..6008c4ec 100755
--- a/js/components/layout/tool-button.reel/tool-button.js
+++ b/js/components/layout/tool-button.reel/tool-button.js
@@ -48,19 +48,8 @@ exports.ToolButton = Montage.create(Component, {
48 this.element.addEventListener("mousedown", this, false); 48 this.element.addEventListener("mousedown", this, false);
49 this.element.addEventListener("dblclick", this, false); 49 this.element.addEventListener("dblclick", this, false);
50 50
51 Object.defineBinding(this, "selected", {
52 boundObject: this.data,
53 boundObjectPropertyPath: "selected",
54 oneway: false
55 });
56
57 if(this.data.container) { 51 if(this.data.container) {
58 this.element.title = this.data.subtools[this._subselected].toolTip; 52 this.element.title = this.data.subtools[this._subselected].toolTip;
59 Object.defineBinding(this, "subselected", {
60 boundObject: this.data.subtools,
61 boundObjectPropertyPath: "selected",
62 oneway: true
63 });
64 } 53 }
65 54
66 this.element.classList.add(this.data.id) 55 this.element.classList.add(this.data.id)
diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html
index d5c33624..df603bf8 100755
--- a/js/components/layout/tools-list.reel/tools-list.html
+++ b/js/components/layout/tools-list.reel/tools-list.html
@@ -16,11 +16,7 @@
16 "element": {"#": "toolbutton"} 16 "element": {"#": "toolbutton"}
17 }, 17 },
18 "bindings": { 18 "bindings": {
19 "data": { 19 "data": {"<-": "@repetition1.objectAtCurrentIteration"}
20 "boundObject": {"@": "repetition1"},
21 "boundObjectPropertyPath": "objectAtCurrentIteration",
22 "oneway": true
23 }
24 } 20 }
25 }, 21 },
26 22
@@ -30,11 +26,7 @@
30 "element": {"#": "groupLine"} 26 "element": {"#": "groupLine"}
31 }, 27 },
32 "bindings": { 28 "bindings": {
33 "condition": { 29 "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"}
34 "boundObject": {"@": "repetition1"},
35 "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup",
36 "oneway": true
37 }