From 2364c671ffc2953e3ee8dfdf037244de8fab3920 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 16:30:33 -0800 Subject: IKNINJA-1238 fix and fixing other js errors on switching and closing documents Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/stage/stage-view.reel') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 91047e51..ad67cada 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -125,6 +125,10 @@ exports.StageView = Montage.create(Component, { 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(); @@ -135,7 +139,6 @@ exports.StageView = Montage.create(Component, { if(this.application.ninja.documentController.activeDocument.currentView === "design") { this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe - this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; //reinitialize draw-util, snapmanager and view-util this.application.ninja.stage.stageDeps.reinitializeForSwitchDocument(); -- cgit v1.2.3