From 24d1873302b2fffc25d254e15e8aa36f59eedb88 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:36:05 -0700 Subject: fixed a switch documents bug where the layout was getting called before setting the container. Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/controllers') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index ea4022b8..f1523d87 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -492,6 +492,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, currentDocument.model.views.design.hide(); } + this.application.ninja.stage.clearAllCanvas(); + if(didCreate) { newDocument.model.views.design.iframe.style.opacity = 1; NJevent("onOpenDocument", newDocument); @@ -499,7 +501,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.activeDocument = newDocument; newDocument.model.views.design.show(); newDocument.deserializeDocument(); - NJevent("switchDocument"); + NJevent("onSwitchDocument"); } } }, -- cgit v1.2.3