aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage.reel')
-rwxr-xr-xjs/stage/stage.reel/stage.js71
1 files changed, 53 insertions, 18 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 73d3aaf4..69cfa7ba 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -468,26 +468,19 @@ exports.Stage = Montage.create(Component, {
468 */ 468 */
469 handleScroll: { 469 handleScroll: {
470 value: function() { 470 value: function() {
471 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
472 if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") {
473 this._scrollLeft = this._iframeContainer.scrollLeft;
474 this._scrollTop = this._iframeContainer.scrollTop;
475 471
476 this.userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder; 472 this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft;
477 this.userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder; 473 this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop;
478 } else {
479 this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft;
480 this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop;
481 474
482 this.userContentLeft = this._documentOffsetLeft - this._scrollLeft; 475 this.userContentLeft = this._documentOffsetLeft - this._scrollLeft;
483 this.userContentTop = this._documentOffsetTop - this._scrollTop; 476 this.userContentTop = this._documentOffsetTop - this._scrollTop;
477
478 // TODO - scroll events are not dependable. We may need to use a timer to simulate
479 // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values
480 // on mouse down.
481 // this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11;
482 // this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11;
484 483
485 // TODO - scroll events are not dependable. We may need to use a timer to simulate
486 // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values
487 // on mouse down.
488// this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11;
489// this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11;
490 }
491 484
492 // Need to clear the snap cache and set up the drag plane 485 // Need to clear the snap cache and set up the drag plane
493 //snapManager.setupDragPlaneFromPlane( workingPlane ); 486 //snapManager.setupDragPlaneFromPlane( workingPlane );
@@ -1012,5 +1005,47 @@ exports.Stage = Montage.create(Component, {
1012 this._iframeContainer.scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; 1005 this._iframeContainer.scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll;
1013 this._scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; 1006 this._scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll;
1014 } 1007 }
1015 } 1008 },
1009
1010 showRulers:{
1011 value:function(){
1012 this.application.ninja.rulerTop.style.display = "block";
1013 this.application.ninja.rulerLeft.style.display = "block";
1014 }
1015 },
1016 hideRulers:{
1017 value:function(){
1018 this.application.ninja.rulerTop.style.display = "none";
1019 this.application.ninja.rulerLeft.style.display = "none";
1020 }
1021 },
1022 showCodeViewBar:{
1023 value:function(isCodeView){
1024 if(isCodeView === true) {
1025 this.application.ninja.editorViewOptions.element.style.display = "block";
1026 this.application.ninja.documentBar.element.style.display = "none";
1027 } else {
1028 this.application.ninja.documentBar.element.style.display = "block";
1029 this.application.ninja.editorViewOptions.element.style.display = "none";
1030 }
1031 }
1032 },
1033
1034 collapseAllPanels:{
1035 value:function(){
1036 this.application.ninja.panelSplitter.collapse();
1037 this.application.ninja.timelineSplitter.collapse();
1038 this.application.ninja.toolsSplitter.collapse();
1039 this.application.ninja.optionsSplitter.collapse();
1040 }
1041 },
1042 restoreAllPanels:{
1043 value:function(){
1044 this.application.ninja.panelSplitter.restore();
1045 this.application.ninja.timelineSplitter.restore();
1046 this.application.ninja.toolsSplitter.restore();
1047 this.application.ninja.optionsSplitter.restore();
1048 }
1049 }
1050
1016}); \ No newline at end of file 1051}); \ No newline at end of file