diff options
author | Nivesh Rajbhandari | 2012-05-16 15:56:54 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-16 15:56:54 -0700 |
commit | 727ad95f6828821f0682aa98104783e4bbda78b4 (patch) | |
tree | 9fec70e89ca02ac7c205da34522999c3ba729777 /js/stage | |
parent | ffea71abfac12d99b106b5c250ec77d5f14ff88e (diff) | |
download | ninja-727ad95f6828821f0682aa98104783e4bbda78b4.tar.gz |
Inline style for html's padding for content in negative space to guarantee highest specificity. Also, set up scrollbars when opening files with content in negative space.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 854b5a2d..28356d1a 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -195,8 +195,10 @@ exports.Stage = Montage.create(Component, { | |||
195 | set: function(value) { | 195 | set: function(value) { |
196 | this._userPaddingLeft = value; | 196 | this._userPaddingLeft = value; |
197 | this._documentOffsetLeft = -value; | 197 | this._documentOffsetLeft = -value; |
198 | this.application.ninja.stylesController.setElementStyle(this._documentRoot.ownerDocument.getElementsByTagName("HTML")[0], | 198 | if(!this._documentRoot) { |
199 | "padding-left", -value + "px", true); | 199 | this._documentRoot = this.application.ninja.currentDocument.documentRoot; |
200 | } | ||
201 | this._documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-left"] = -value + "px"; | ||
200 | this.userContentLeft = this._documentOffsetLeft; | 202 | this.userContentLeft = this._documentOffsetLeft; |
201 | this.updatedStage = true; | 203 | this.updatedStage = true; |
202 | } | 204 | } |
@@ -207,8 +209,10 @@ exports.Stage = Montage.create(Component, { | |||
207 | set: function(value) { | 209 | set: function(value) { |
208 | this._userPaddingTop = value; | 210 | this._userPaddingTop = value; |
209 | this._documentOffsetTop = -value; | 211 | this._documentOffsetTop = -value; |
210 | this.application.ninja.stylesController.setElementStyle(this._documentRoot.ownerDocument.getElementsByTagName("HTML")[0], | 212 | if(!this._documentRoot) { |
211 | "padding-top", -value + "px", true); | 213 | this._documentRoot = this.application.ninja.currentDocument.documentRoot; |
214 | } | ||
215 | this._documentRoot.ownerDocument.getElementsByTagName("HTML")[0].style["padding-top"] = -value + "px"; | ||
212 | this.userContentTop = this._documentOffsetTop; | 216 | this.userContentTop = this._documentOffsetTop; |
213 | this.updatedStage = true; | 217 | this.updatedStage = true; |
214 | } | 218 | } |
@@ -314,8 +318,8 @@ exports.Stage = Montage.create(Component, { | |||
314 | 318 | ||
315 | this._scrollLeft = 0; | 319 | this._scrollLeft = 0; |
316 | this._scrollTop = 0; | 320 | this._scrollTop = 0; |
317 | this._userContentLeft = 0; | 321 | this._userContentLeft = this._documentOffsetLeft; |
318 | this._userContentTop = 0; | 322 | this._userContentTop = this._documentOffsetTop; |
319 | 323 | ||
320 | this._maxHorizontalScroll = this._documentRoot.scrollWidth - this._canvas.width - 11; | 324 | this._maxHorizontalScroll = this._documentRoot.scrollWidth - this._canvas.width - 11; |
321 | this._maxVerticalScroll = this._documentRoot.scrollHeight - this._canvas.height - 11; | 325 | this._maxVerticalScroll = this._documentRoot.scrollHeight - this._canvas.height - 11; |