diff options
author | Eric Guzman | 2012-05-18 21:51:08 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-18 21:51:08 -0700 |
commit | 84097be9d7dd3403a0ac12f8c039d3ffc5281cfc (patch) | |
tree | 4f03ddf6620be09d4a755bdf647da2adc1df8908 /js/document/models | |
parent | 13da56e791b7478ad3dbb8162a583a6b2c8c4b6b (diff) | |
parent | 10471fc02fa75040baf337bc62ff683854793f81 (diff) | |
download | ninja-84097be9d7dd3403a0ac12f8c039d3ffc5281cfc.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into CSSPanelUpdates
Diffstat (limited to 'js/document/models')
-rwxr-xr-x | js/document/models/base.js | 20 | ||||
-rwxr-xr-x | js/document/models/html.js | 17 |
2 files changed, 33 insertions, 4 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js index 649539ea..c99e36c7 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -30,7 +30,7 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
30 | //////////////////////////////////////////////////////////////////// | 30 | //////////////////////////////////////////////////////////////////// |
31 | // | 31 | // |
32 | _isActive: { | 32 | _isActive: { |
33 | value: null | 33 | value: true |
34 | }, | 34 | }, |
35 | //////////////////////////////////////////////////////////////////// | 35 | //////////////////////////////////////////////////////////////////// |
36 | // | 36 | // |
@@ -151,7 +151,7 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
151 | head: this.views.design.iframe.contentWindow.document.head, | 151 | head: this.views.design.iframe.contentWindow.document.head, |
152 | body: this.views.design.iframe.contentWindow.document.body, | 152 | body: this.views.design.iframe.contentWindow.document.body, |
153 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator | 153 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator |
154 | }, callback.bind(this)); | 154 | }, this.handleSaved.bind({callback: callback, model: this})); |
155 | } else { | 155 | } else { |
156 | //TODO: Add logic to save code view data | 156 | //TODO: Add logic to save code view data |
157 | } | 157 | } |
@@ -180,7 +180,7 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
180 | head: this.views.design.iframe.contentWindow.document.head, | 180 | head: this.views.design.iframe.contentWindow.document.head, |
181 | body: this.views.design.iframe.contentWindow.document.body, | 181 | body: this.views.design.iframe.contentWindow.document.body, |
182 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator | 182 | mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator |
183 | }, callback.bind(this)); | 183 | }, this.handleSaved.bind({callback: callback, model: this})); |
184 | } else { | 184 | } else { |
185 | //TODO: Add logic to save code view data | 185 | //TODO: Add logic to save code view data |
186 | } | 186 | } |
@@ -190,7 +190,7 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
190 | //////////////////////////////////////////////////////////////////// | 190 | //////////////////////////////////////////////////////////////////// |
191 | // | 191 | // |
192 | saveAs: { | 192 | saveAs: { |
193 | value: function () { | 193 | value: function (callback) { |
194 | // | 194 | // |
195 | if (this.needsSave) { | 195 | if (this.needsSave) { |
196 | //Save current file on memory | 196 | //Save current file on memory |
@@ -201,6 +201,18 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
201 | }, | 201 | }, |
202 | //////////////////////////////////////////////////////////////////// | 202 | //////////////////////////////////////////////////////////////////// |
203 | // | 203 | // |
204 | handleSaved: { | ||
205 | value: function (result) { | ||
206 | // | ||
207 | if (result.status === 204) { | ||
208 | this.model.needsSave = false; | ||
209 | } | ||
210 | // | ||
211 | if (this.callback) this.callback(result); | ||
212 | } | ||
213 | }, | ||
214 | //////////////////////////////////////////////////////////////////// | ||
215 | // | ||
204 | close: { | 216 | close: { |
205 | value: function (view, callback) { | 217 | value: function (view, callback) { |
206 | //Outcome of close (pending on save logic) | 218 | //Outcome of close (pending on save logic) |
diff --git a/js/document/models/html.js b/js/document/models/html.js index 67457863..a97b4b5a 100755 --- a/js/document/models/html.js +++ b/js/document/models/html.js | |||
@@ -28,6 +28,23 @@ exports.HtmlDocumentModel = Montage.create(BaseDocumentModel, { | |||
28 | value: false | 28 | value: false |
29 | }, | 29 | }, |
30 | //////////////////////////////////////////////////////////////////// | 30 | //////////////////////////////////////////////////////////////////// |
31 | // | ||
32 | scrollLeft: { | ||
33 | value: null | ||
34 | }, | ||
35 | |||
36 | scrollTop: { | ||
37 | value: null | ||
38 | }, | ||
39 | |||
40 | userContentLeft: { | ||
41 | value: null | ||
42 | }, | ||
43 | |||
44 | userContentTop: { | ||
45 | value: null | ||
46 | }, | ||
47 | //////////////////////////////////////////////////////////////////// | ||
31 | // | 48 | // |
32 | baseHref: { | 49 | baseHref: { |
33 | value: null | 50 | value: null |