diff options
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-x | js/document/document-html.js | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index 56d9db02..f92a425c 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -119,38 +119,45 @@ exports.HtmlDocument = Montage.create(Component, { | |||
119 | this._observer = null; | 119 | this._observer = null; |
120 | //Making callback after view is loaded | 120 | //Making callback after view is loaded |
121 | this.loaded.callback.call(this.loaded.context, this); | 121 | this.loaded.callback.call(this.loaded.context, this); |
122 | //Setting opacity to be viewable after load | ||
123 | this.model.views.design.iframe.style.opacity = 1; | ||
124 | } | 122 | } |
125 | }, | 123 | }, |
126 | //////////////////////////////////////////////////////////////////// | 124 | //////////////////////////////////////////////////////////////////// |
127 | // | 125 | // |
128 | closeDocument: { | 126 | closeDocument: { |
129 | value: function (context, callback) { | 127 | value: function (context, callback) { |
128 | //Closing document and getting outcome | ||
130 | var closed = this.model.close(null); | 129 | var closed = this.model.close(null); |
131 | 130 | //Making callback if specified | |
132 | callback.call(context, this); | 131 | if (callback) callback.call(context, this); |
133 | } | 132 | } |
134 | }, | 133 | }, |
135 | //////////////////////////////////////////////////////////////////// | 134 | //////////////////////////////////////////////////////////////////// |
136 | // | 135 | // |
137 | serializeDocument: { | 136 | serializeDocument: { |
138 | value: function () { | 137 | value: function () { |
139 | // There are not needed for now ssince we cannot change them | 138 | // There are not needed for now since we cannot change them |
140 | //this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; | 139 | //this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; |
141 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; | 140 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; |
142 | 141 | ||
143 | // Serialize the current scroll position | 142 | // Serialize the current scroll position |
144 | // TODO: Implement | 143 | //TODO: Move these properties to the design view class |
144 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; | ||
145 | this.model.scrollTop = this.application.ninja.stage._scrollTop; | ||
146 | this.model.userContentLeft = this.application.ninja.stage._userContentLeft; | ||
147 | this.model.userContentTop = this.application.ninja.stage._userContentTop; | ||
148 | |||
145 | 149 | ||
146 | // Serialize the selection | 150 | // Serialize the selection, the container and grid |
151 | //TODO: Move this property to the design view class | ||
147 | this.model.selection = this.application.ninja.selectedElements.slice(0); | 152 | this.model.selection = this.application.ninja.selectedElements.slice(0); |
153 | this.model.selectionContainer = this.application.ninja.currentSelectedContainer; | ||
148 | this.draw3DGrid = this.application.ninja.appModel.show3dGrid; | 154 | this.draw3DGrid = this.application.ninja.appModel.show3dGrid; |
149 | 155 | ||
150 | // Serialize the undo | 156 | // Serialize the undo |
151 | // TODO: Save the montage undo queue | 157 | // TODO: Save the montage undo queue |
152 | 158 | ||
153 | // Pause the videos | 159 | // Pause the videos |
160 | //TODO: Move these to be handled on the show/hide methods in the view | ||
154 | this.model.views.design.pauseVideos(); | 161 | this.model.views.design.pauseVideos(); |
155 | } | 162 | } |
156 | }, | 163 | }, |
@@ -158,7 +165,27 @@ exports.HtmlDocument = Montage.create(Component, { | |||
158 | // | 165 | // |
159 | deserializeDocument: { | 166 | deserializeDocument: { |
160 | value: function () { | 167 | value: function () { |
161 | //TODO: Import functionality | 168 | // There are not needed for now since we cannot change them |
169 | //this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; | ||
170 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; | ||
171 | |||
172 | // Deserialize the current scroll position | ||
173 | //TODO: Move these properties to the design view class | ||
174 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; | ||
175 | this.application.ninja.stage._scrollTop = this.model.scrollTop; | ||
176 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; | ||
177 | this.application.ninja.stage._userContentTop = this.model.userContentTop; | ||
178 | |||
179 | //TODO: Move this property to the design view class | ||
180 | this.application.ninja.selectedElements = this.model.selection.slice(0); | ||
181 | // this.application.ninja.currentSelectedContainer = this.model.selectionContainer; | ||
182 | this.application.ninja.appModel.show3dGrid = this.draw3DGrid; | ||
183 | |||
184 | // Serialize the undo | ||
185 | // TODO: Save the montage undo queue | ||
186 | |||
187 | //TODO: Move this to the document controller | ||
188 | this.model.isActive = true; | ||
162 | } | 189 | } |
163 | } | 190 | } |
164 | //////////////////////////////////////////////////////////////////// | 191 | //////////////////////////////////////////////////////////////////// |