From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/stage/stage-deps.js | 13 +++++-------- js/stage/stage-view.reel/stage-view.js | 22 ---------------------- 2 files changed, 5 insertions(+), 30 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js index 17039438..84f04249 100755 --- a/js/stage/stage-deps.js +++ b/js/stage/stage-deps.js @@ -55,8 +55,9 @@ exports.StageDeps = Montage.create(Component, { deserializedFromTemplate: { value: function() { - this.eventManager.addEventListener( "appLoaded", this, false); - this.eventManager.addEventListener( "openDocument", this, false); + this.eventManager.addEventListener("appLoaded", this, false); + this.eventManager.addEventListener("openDocument", this, false); + this.eventManager.addEventListener("switchDocument", this, false); // Initialize Deps // HACK @@ -111,9 +112,8 @@ exports.StageDeps = Montage.create(Component, { } }, - reinitializeForSwitchDocument: { - value: function() { - + handleSwitchDocument: { + value: function(){ workingPlane = [0,0,1,0]; snapManager._isCacheInvalid = true; @@ -122,7 +122,4 @@ exports.StageDeps = Montage.create(Component, { drawUtils.initializeFromDocument(); } } - - - }); \ No newline at end of file diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index ba94fadf..757c5e51 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -112,28 +112,6 @@ exports.StageView = Montage.create(Component, { */ switchDocument:{ value: function(doc){ - this.application.ninja.documentController._hideCurrentDocument(); - this.application.ninja.documentController.activeDocument = doc; - - if(this.application.ninja.documentController.activeDocument.currentView === "design") { - this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; - } - - this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - - -// this.application.ninja.documentController._showCurrentDocument(); - // Inline function below - if(this.activeDocument) { - this.activeDocument.container.style["display"] = "block"; - if(this.activeDocument.currentView === "design"){ - this.activeDocument.container.parentNode.style["display"] = "block"; - this.activeDocument.restoreAppState(); - } else { - //hide the iframe when switching to code view - document.getElementById("iframeContainer").style.display = "none"; - } - } //focus editor -- cgit v1.2.3