aboutsummaryrefslogtreecommitdiff
path: root/js/components/layout
diff options
context:
space:
mode:
authorJon Reid2012-06-15 10:10:41 -0700
committerJon Reid2012-06-15 10:10:41 -0700
commit526ac54f73d53e1e2a3d6a4dbf4f9992c143baf7 (patch)
tree65939e59615aaa10a7db77211e71616ad531bd0e /js/components/layout
parentb5b760ee82e5cc4da176914983a6002cbf86c11a (diff)
parent5ee0c89fa0c7acc280ff3b884767e8513fd0b315 (diff)
downloadninja-526ac54f73d53e1e2a3d6a4dbf4f9992c143baf7.tar.gz
Merge remote-tracking branch 'ninja-internal/master' into test-merge
Conflicts: js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
Diffstat (limited to 'js/components/layout')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html2
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js48
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.html2
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js7
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js5
-rwxr-xr-xjs/components/layout/documents-tab.reel/documents-tab.js3
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.html2
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.html5
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.js106
-rwxr-xr-xjs/components/layout/tools-properties.reel/tools-properties.html54
-rwxr-xr-xjs/components/layout/tools-properties.reel/tools-properties.js82
11 files changed, 233 insertions, 83 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index 0dabc781..68f3be2b 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -40,7 +40,7 @@
40 "buttonsListController": { 40 "buttonsListController": {
41 "prototype": "montage/ui/controller/array-controller", 41 "prototype": "montage/ui/controller/array-controller",
42 "bindings": { 42 "bindings": {
43 "content": {"<<->": "@owner.containerElements"} 43 "content": {"<->": "@owner.containerElements"}
44 } 44 }
45 }, 45 },
46 46
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index ac131f2c..a3c743a4 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -9,6 +9,11 @@ var Montage = require("montage/core/core").Montage,
9 9
10exports.Breadcrumb = Montage.create(Component, { 10exports.Breadcrumb = Montage.create(Component, {
11 11
12 breadcrumbBt: {
13 value: null,
14 serializable: true
15 },
16
12 _currentDocument: { 17 _currentDocument: {
13 enumerable: false, 18 enumerable: false,
14 value: null 19 value: null
@@ -51,22 +56,6 @@ exports.Breadcrumb = Montage.create(Component, {
51 } 56 }
52 }, 57 },
53 58
54 _container:{
55 value:null
56 },
57
58 container: {
59 set: function(value) {
60 if(this._container !== value) {
61 this._container = value;
62 this.createContainerElements();
63 }
64 },
65 get: function() {
66 return this._container;
67 }
68 },
69
70 containerElements: { 59 containerElements: {
71 value: [] 60 value: []
72 }, 61 },
@@ -74,31 +63,37 @@ exports.Breadcrumb = Montage.create(Component, {
74 prepareForDraw: { 63 prepareForDraw: {
75 value: function() { 64 value: function() {
76 this.breadcrumbBt.addEventListener("action", this, false); 65 this.breadcrumbBt.addEventListener("action", this, false);
66 this.addPropertyChangeListener("currentDocument.model.domContainer", this)
77 } 67 }
78 }, 68 },
79 69
80 createContainerElements: { 70 handleChange: {
81 value: function() { 71 value: function() {
82 var parentNode; 72 if(this.currentDocument && this.currentDocument.model.getProperty("domContainer")) {
73 this.createContainerElements(this.currentDocument.model.getProperty("domContainer"));
74 }
75 }
76 },
77
78 createContainerElements: {
79 value: function(container) {
83 80
84// delete this.containerElements; 81// delete this.containerElements;
85 this.containerElements = []; 82 this.containerElements = [];
86 83
87 parentNode = this.container; 84 while(container !== this.currentDocument.model.documentRoot) {
88 85 this.containerElements.unshift({"node": container, "nodeUuid":container.uuid, "label": container.nodeName});
89 while(parentNode !== this.currentDocument.model.documentRoot) { 86 container = container.parentNode;
90 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
91 parentNode = parentNode.parentNode;
92 } 87 }
93 88
94 // This is always the top container which is now hardcoded to body 89 // This is always the top container which is now hardcoded to body
95 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); 90 this.containerElements.unshift({"node": container, "nodeUuid":container.uuid, "label": container.nodeName});
96 } 91 }
97 }, 92 },
98 93
99 handleAction: { 94 handleAction: {
100 value: function(evt) { 95 value: function(evt) {
101 if(evt.target.value === this.container.uuid) { 96 if(evt.target.value === this.currentDocument.model.domContainer.uuid) {
102 return; 97 return;
103 } 98 }
104 99
@@ -109,7 +104,8 @@ exports.Breadcrumb = Montage.create(Component, {
109 } 104 }
110 105
111 // TODO: This is bound 2 ways, update the internal property 106 // TODO: This is bound 2 ways, update the internal property
112 this.application.ninja.currentSelectedContainer = this.containerElements[i].node; 107 this.currentDocument.model.domContainer = this.containerElements[i].node;
108 this.application.ninja.selectionController.executeSelectElement();
113 } 109 }
114 } 110 }
115}); 111});
diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html
index a35b5590..889160ad 100755
--- a/js/components/layout/document-bar.reel/document-bar.html
+++ b/js/components/layout/document-bar.reel/document-bar.html
@@ -45,8 +45,6 @@
45 "prototype": "js/components/layout/document-bar.reel", 45 "prototype": "js/components/layout/document-bar.reel",
46 "properties": { 46 "properties": {
47 "element": {"#": "documentBar"}, 47 "element": {"#": "documentBar"},
48 "designView": {"#": "design"},
49 "codeView": {"#": "code"},
50 "zoomControl": {"@": "hottext1"} 48 "zoomControl": {"@": "hottext1"}
51 } 49 }
52 } 50 }
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js
index 1cb0bd90..74ba11c2 100755
--- a/js/components/layout/document-bar.reel/document-bar.js
+++ b/js/components/layout/document-bar.reel/document-bar.js
@@ -61,7 +61,8 @@ exports.DocumentBar = Montage.create(Component, {
61 }, 61 },
62 62
63 zoomControl: { 63 zoomControl: {
64 value: null 64 value: null,
65 serializable: true
65 }, 66 },
66 67
67 _type: { 68 _type: {
@@ -148,8 +149,8 @@ exports.DocumentBar = Montage.create(Component, {
148 149
149 prepareForDraw: { 150 prepareForDraw: {
150 value: function() { 151 value: function() {
151 this.designView.addEventListener("click", this, false); 152// this.designView.addEventListener("click", this, false);
152 this.codeView.addEventListener("click", this, false); 153// this.codeView.addEventListener("click", this, false);
153 154
154 } 155 }
155 }, 156 },
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index 94056007..e2a36c46 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -9,6 +9,11 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentEntry = Montage.create(Component, { 10exports.DocumentEntry = Montage.create(Component, {
11 11
12 label: {
13 value: null,
14 serializable: true
15 },
16
12 _document: { 17 _document: {
13 value: null 18 value: null
14 }, 19 },
diff --git a/js/components/layout/documents-tab.reel/documents-tab.js b/js/components/layout/documents-tab.reel/documents-tab.js
index 41c98b30..b72056f8 100755
--- a/js/components/layout/documents-tab.reel/documents-tab.js
+++ b/js/components/layout/documents-tab.reel/documents-tab.js
@@ -9,6 +9,7 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.DocumentsTab = Montage.create(Component, { 10exports.DocumentsTab = Montage.create(Component, {
11 contentController: { 11 contentController: {
12 value: null 12 value: null,
13 serializable: true
13 } 14 }
14}); \ No newline at end of file