From 302ae3c1812086d976eb67c9cf693c43205f3904 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 16 Feb 2012 11:13:05 -0800 Subject: hide the rulers when no document is open Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 2144af84..cd19f361 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -123,7 +123,7 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ //save editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true); } this.application.ninja.documentController._hideCurrentDocument(); @@ -136,7 +136,7 @@ exports.StageView = Montage.create(Component, { var documentController = this.application.ninja.documentController; //restore editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline); document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); } -- cgit v1.2.3