diff options
author | Valerio Virgillito | 2012-06-04 10:20:57 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-04 10:20:57 -0700 |
commit | c1ec69879028220b0c3f11ad6e24035bf527802c (patch) | |
tree | 043bfe4ec9e08f4f598a4845ae5fbcddacc7c8fb /js/document | |
parent | 3abba04025dbc0daadb08184833a2558c442b8e1 (diff) | |
parent | 266460e52831c5b3a3473be420756fd88bb8aced (diff) | |
download | ninja-c1ec69879028220b0c3f11ad6e24035bf527802c.tar.gz |
Merge pull request #264 from mencio/document-bindings-fix
Document bindings fix - Changing the documents architecture to use bindings instead of events
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/document-html.js | 21 | ||||
-rwxr-xr-x | js/document/models/base.js | 14 | ||||
-rwxr-xr-x | js/document/models/html.js | 5 | ||||
-rwxr-xr-x | js/document/models/text.js | 3 | ||||
-rwxr-xr-x | js/document/views/code.js | 6 | ||||
-rwxr-xr-x | js/document/views/design.js | 5 |
6 files changed, 15 insertions, 39 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index b5684dc5..33a41a8e 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -119,10 +119,6 @@ exports.HtmlDocument = Montage.create(Component, { | |||
119 | // | 119 | // |
120 | serializeDocument: { | 120 | serializeDocument: { |
121 | value: function () { | 121 | value: function () { |
122 | // There are not needed for now since we cannot change them | ||
123 | //this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; | ||
124 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; | ||
125 | |||
126 | // Serialize the current scroll position | 122 | // Serialize the current scroll position |
127 | //TODO: Move these properties to the design view class | 123 | //TODO: Move these properties to the design view class |
128 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; | 124 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; |
@@ -134,11 +130,6 @@ exports.HtmlDocument = Montage.create(Component, { | |||
134 | // Serialize the selection, the container and grid | 130 | // Serialize the selection, the container and grid |
135 | //TODO: Move this property to the design view class | 131 | //TODO: Move this property to the design view class |
136 | this.model.selection = this.application.ninja.selectedElements.slice(0); | 132 | this.model.selection = this.application.ninja.selectedElements.slice(0); |
137 | this.model.selectionContainer = this.application.ninja.currentSelectedContainer; | ||
138 | this.draw3DGrid = this.application.ninja.appModel.show3dGrid; | ||
139 | |||
140 | // Serialize the undo | ||
141 | // TODO: Save the montage undo queue | ||
142 | 133 | ||
143 | // Pause the videos | 134 | // Pause the videos |
144 | //TODO: Move these to be handled on the show/hide methods in the view | 135 | //TODO: Move these to be handled on the show/hide methods in the view |
@@ -149,27 +140,15 @@ exports.HtmlDocument = Montage.create(Component, { | |||
149 | // | 140 | // |
150 | deserializeDocument: { | 141 | deserializeDocument: { |
151 | value: function () { | 142 | value: function () { |
152 | // There are not needed for now since we cannot change them | ||
153 | //this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; | ||
154 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; | ||
155 | |||
156 | // Deserialize the current scroll position | 143 | // Deserialize the current scroll position |
157 | //TODO: Move these properties to the design view class | 144 | //TODO: Move these properties to the design view class |
158 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; | 145 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; |
159 | this.application.ninja.stage._scrollTop = this.model.scrollTop; | 146 | this.application.ninja.stage._scrollTop = this.model.scrollTop; |
160 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; | 147 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; |
161 | this.application.ninja.stage._userContentTop = this.model.userContentTop; | 148 | this.application.ninja.stage._userContentTop = this.model.userContentTop; |
162 | |||
163 | //TODO: Move this property to the design view class | ||
164 | this.application.ninja.selectedElements = this.model.selection.slice(0); | ||
165 | // this.application.ninja.currentSelectedContainer = this.model.selectionContainer; | ||
166 | this.application.ninja.appModel.show3dGrid = this.draw3DGrid; | ||
167 | 149 | ||
168 | // Serialize the undo | 150 | // Serialize the undo |
169 | // TODO: Save the montage undo queue | 151 | // TODO: Save the montage undo queue |
170 | |||
171 | //TODO: Move this to the document controller | ||
172 | this.model.isActive = true; | ||
173 | } | 152 | } |
174 | } | 153 | } |
175 | //////////////////////////////////////////////////////////////////// | 154 | //////////////////////////////////////////////////////////////////// |
diff --git a/js/document/models/base.js b/js/document/models/base.js index 6d9d2e89..76a5e62b 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -62,6 +62,20 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
62 | }, | 62 | }, |
63 | //////////////////////////////////////////////////////////////////// | 63 | //////////////////////////////////////////////////////////////////// |
64 | // | 64 | // |
65 | _selection: { | ||
66 | value: [] | ||
67 | }, | ||
68 | |||
69 | selection: { | ||
70 | get: function() { | ||
71 | return this._selection; | ||
72 | }, | ||
73 | set: function(value) { | ||
74 | this._selection = value; | ||
75 | } | ||
76 | }, | ||
77 | //////////////////////////////////////////////////////////////////// | ||
78 | // | ||
65 | fileTemplate: { | 79 | fileTemplate: { |
66 | value: null | 80 | value: null |
67 | }, | 81 | }, |
diff --git a/js/document/models/html.js b/js/document/models/html.js index 0fe33990..9aa0d27e 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js | |||
@@ -27,11 +27,6 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { | |||
27 | }, | 27 | }, |
28 | //////////////////////////////////////////////////////////////////// | 28 | //////////////////////////////////////////////////////////////////// |
29 | // | 29 | // |
30 | selection: { | ||
31 | value: [] | ||
32 | }, | ||
33 | //////////////////////////////////////////////////////////////////// | ||
34 | // | ||
35 | selectionContainer: { | 30 | selectionContainer: { |
36 | value: [] | 31 | value: [] |
37 | }, | 32 | }, |
diff --git a/js/document/models/text.js b/js/document/models/text.js index d1252b7d..6cb61d48 100755 --- a/js/document/models/text.js +++ b/js/document/models/text.js | |||
@@ -22,7 +22,7 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, { | |||
22 | save: { | 22 | save: { |
23 | enumerable: false, | 23 | enumerable: false, |
24 | value: function (callback) { | 24 | value: function (callback) { |
25 | this.application.ninja.documentController.activeDocument.model.views.code.editor.save();//save to textarea | 25 | this.application.ninja.currentDocument.model.views.code.editor.save();//save to textarea |
26 | 26 | ||
27 | var self = this; | 27 | var self = this; |
28 | 28 | ||
@@ -60,7 +60,6 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, { | |||
60 | } | 60 | } |
61 | // | 61 | // |
62 | this.parentContainer.removeChild(this.views.code.textViewContainer); | 62 | this.parentContainer.removeChild(this.views.code.textViewContainer); |
63 | this.application.ninja.stage.showCodeViewBar(false); | ||
64 | this.application.ninja.stage.restoreAllPanels(); | 63 | this.application.ninja.stage.restoreAllPanels(); |
65 | this.views.code = null; | 64 | this.views.code = null; |
66 | 65 | ||
diff --git a/js/document/views/code.js b/js/document/views/code.js index 0a0ff5c1..c8b2a23e 100755 --- a/js/document/views/code.js +++ b/js/document/views/code.js | |||
@@ -82,12 +82,6 @@ exports.CodeDocumentView = Montage.create(BaseDocumentView, { | |||
82 | // | 82 | // |
83 | var type; | 83 | var type; |
84 | // | 84 | // |
85 | if(this.activeDocument) { | ||
86 | //need to hide only if another document was open before | ||
87 | //this.application.ninja.documentController._hideCurrentDocument(); | ||
88 | //this.hideOtherDocuments(doc.uuid); | ||
89 | } | ||
90 | // | ||
91 | switch(file.extension) { | 85 | switch(file.extension) { |
92 | case "css" : | 86 | case "css" : |
93 | type = "css"; | 87 | type = "css"; |
diff --git a/js/document/views/design.js b/js/document/views/design.js index dedfe8b6..9aeb370a 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -63,11 +63,6 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
63 | set: function(value) {this._document = value;} | 63 | set: function(value) {this._document = value;} |
64 | }, | 64 | }, |
65 | //////////////////////////////////////////////////////////////////// | 65 | //////////////////////////////////////////////////////////////////// |
66 | // | ||
67 | propertiesPanel: { | ||
68 | value: null | ||
69 | }, | ||
70 | //////////////////////////////////////////////////////////////////// | ||
71 | // | 66 | // |
72 | _liveNodeList: { | 67 | _liveNodeList: { |
73 | value: null | 68 | value: null |