From 66632a6e0de0998ff6d36abdaa8c3a546eada0f5 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 30 May 2012 23:02:46 -0700 Subject: fixing the closing of documents Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 3 +-- js/document/document-html.js | 2 ++ js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index e059e7e1..13ab33cc 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -53,10 +53,9 @@ exports.DocumentController = Montage.create(Component, { document.getElementById("iframeContainer").style.display = "block"; document.getElementById("codeViewContainer").style.display = "block"; } else if(this._currentDocument.currentView === "design") { - this._currentDocument.model.currentView.show(); + } else { document.getElementById("iframeContainer").style.display = "none"; - this._currentDocument.model.currentView.show(); } } diff --git a/js/document/document-html.js b/js/document/document-html.js index c60a12a2..377c305a 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -99,6 +99,8 @@ exports.HtmlDocument = Montage.create(Component, { //Removing observer, only needed on initial load this._observer.disconnect(); this._observer = null; + //Show the view + this.model.currentView.show(); //Making callback after view is loaded this.loaded.callback.call(this.loaded.context, this); } diff --git a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js index 49907c9d..104d474d 100755 --- a/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties.reel/sections/three-d-view.reel/three-d-view.js @@ -213,7 +213,7 @@ exports.ThreeD = Montage.create(Component, { this._currentDocument = value; - if(this._currentDocument.currentView === "design") { + if(this._currentDocument && this._currentDocument.currentView === "design") { // Save a reference of the pi inside the document view to be able to clear Object.defineBinding(this, "item", { boundObject: this, -- cgit v1.2.3