From 2cc8e58f6bb9f64a7473e62aecd013fa55167231 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 21 May 2012 16:42:26 -0700 Subject: - added opening multiple code and design view documents - switching between multiple code and design view documents - Note: closing of documents, when multiple documents are open, is not yet implemented Signed-off-by: Ananya Sen --- js/stage/stage.reel/stage.js | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'js/stage/stage.reel') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 73d3aaf4..f768f03a 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -1012,5 +1012,47 @@ exports.Stage = Montage.create(Component, { this._iframeContainer.scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; this._scrollTop = this.application.ninja.documentController.activeDocument.savedTopScroll; } - } + }, + + showRulers:{ + value:function(){ + this.application.ninja.rulerTop.style.display = "block"; + this.application.ninja.rulerLeft.style.display = "block"; + } + }, + hideRulers:{ + value:function(){ + this.application.ninja.rulerTop.style.display = "none"; + this.application.ninja.rulerLeft.style.display = "none"; + } + }, + showCodeViewBar:{ + value:function(isCodeView){ + if(isCodeView === true) { + this.application.ninja.editorViewOptions.element.style.display = "block"; + this.application.ninja.documentBar.element.style.display = "none"; + } else { + this.application.ninja.documentBar.element.style.display = "block"; + this.application.ninja.editorViewOptions.element.style.display = "none"; + } + } + }, + + collapseAllPanels:{ + value:function(){ + this.application.ninja.panelSplitter.collapse(); + this.application.ninja.timelineSplitter.collapse(); + this.application.ninja.toolsSplitter.collapse(); + this.application.ninja.optionsSplitter.collapse(); + } + }, + restoreAllPanels:{ + value:function(){ + this.application.ninja.panelSplitter.restore(); + this.application.ninja.timelineSplitter.restore(); + this.application.ninja.toolsSplitter.restore(); + this.application.ninja.optionsSplitter.restore(); + } + } + }); \ No newline at end of file -- cgit v1.2.3 From 2b207ef8b2594927f8cd6cd63a8483d205cb86c4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 15:41:51 -0700 Subject: fixing the selection in multiple documents and some code cleanup Signed-off-by: Valerio Virgillito --- js/stage/stage.reel/stage.js | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'js/stage/stage.reel') diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index f768f03a..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, { */ handleScroll: { value: function() { - // TODO: Remove marker for old template: NINJA-STAGE-REWORK - if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { - this._scrollLeft = this._iframeContainer.scrollLeft; - this._scrollTop = this._iframeContainer.scrollTop; - this.userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder; - this.userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder; - } else { - this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft; - this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop; + this._scrollLeft = this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft; + this._scrollTop = this.application.ninja.currentDocument.model.views.design.document.body.scrollTop; - this.userContentLeft = this._documentOffsetLeft - this._scrollLeft; - this.userContentTop = this._documentOffsetTop - this._scrollTop; + this.userContentLeft = this._documentOffsetLeft - this._scrollLeft; + this.userContentTop = this._documentOffsetTop - this._scrollTop; + + // TODO - scroll events are not dependable. We may need to use a timer to simulate + // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values + // on mouse down. + // this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11; + // this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11; - // TODO - scroll events are not dependable. We may need to use a timer to simulate - // scrollBegin and scrollEnd. For now, the Pan Tool will keep track of the stage's scroll values - // on mouse down. -// this._maxHorizontalScroll = this.application.ninja.currentDocument.documentRoot.scrollWidth - this._canvas.width - 11; -// this._maxVerticalScroll = this.application.ninja.currentDocument.documentRoot.scrollHeight - this._canvas.height - 11; - } // Need to clear the snap cache and set up the drag plane //snapManager.setupDragPlaneFromPlane( workingPlane ); -- cgit v1.2.3