diff options
author | Valerio Virgillito | 2012-05-18 14:01:00 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-18 14:01:00 -0700 |
commit | 66edf78c7e5df11218ef733686965beab05c7c7d (patch) | |
tree | dc3ce4dd828501c88de7c275b6d04efa8972c209 /js/document | |
parent | 24d1873302b2fffc25d254e15e8aa36f59eedb88 (diff) | |
download | ninja-66edf78c7e5df11218ef733686965beab05c7c7d.tar.gz |
fixing a scrolling issue when multiple documents are switched
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/document-html.js | 11 | ||||
-rwxr-xr-x | js/document/models/html.js | 17 |
2 files changed, 26 insertions, 2 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index 0037c94d..983da966 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -139,7 +139,11 @@ exports.HtmlDocument = Montage.create(Component, { | |||
139 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; | 139 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; |
140 | 140 | ||
141 | // Serialize the current scroll position | 141 | // Serialize the current scroll position |
142 | // TODO: Implement | 142 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; |
143 | this.model.scrollTop = this.application.ninja.stage._scrollTop; | ||
144 | this.model.userContentLeft = this.application.ninja.stage._userContentLeft; | ||
145 | this.model.userContentTop = this.application.ninja.stage._userContentTop; | ||
146 | |||
143 | 147 | ||
144 | // Serialize the selection | 148 | // Serialize the selection |
145 | this.model.selection = this.application.ninja.selectedElements.slice(0); | 149 | this.model.selection = this.application.ninja.selectedElements.slice(0); |
@@ -163,7 +167,10 @@ exports.HtmlDocument = Montage.create(Component, { | |||
163 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; | 167 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; |
164 | 168 | ||
165 | // Deserialize the current scroll position | 169 | // Deserialize the current scroll position |
166 | // TODO: Implement | 170 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; |
171 | this.application.ninja.stage._scrollTop = this.model.scrollTop; | ||
172 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; | ||
173 | this.application.ninja.stage._userContentTop = this.model.userContentTop; | ||
167 | 174 | ||
168 | this.application.ninja.selectedElements = this.model.selection.slice(0); | 175 | this.application.ninja.selectedElements = this.model.selection.slice(0); |
169 | 176 | ||
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 |