diff options
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index b066a9c2..21445214 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -251,7 +251,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
251 | var closeDocumentIndex = this._findIndexByUUID(id); | 251 | var closeDocumentIndex = this._findIndexByUUID(id); |
252 | this._documents.splice(this._findIndexByUUID(id), 1); | 252 | this._documents.splice(this._findIndexByUUID(id), 1); |
253 | 253 | ||
254 | if(this.activeDocument.uuid === id && this._documents.length > 0) { | 254 | if(this.activeDocument.uuid === id && this._documents.length > 0) {//closing the active document tab |
255 | var nextDocumentIndex = -1 ; | 255 | var nextDocumentIndex = -1 ; |
256 | if((this._documents.length > 0) && (closeDocumentIndex === 0)){ | 256 | if((this._documents.length > 0) && (closeDocumentIndex === 0)){ |
257 | nextDocumentIndex = 1; | 257 | nextDocumentIndex = 1; |
@@ -259,7 +259,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
259 | nextDocumentIndex = closeDocumentIndex - 1; | 259 | nextDocumentIndex = closeDocumentIndex - 1; |
260 | } | 260 | } |
261 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 261 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
262 | }else{ | 262 | }else if(this._documents.length === 0){ |
263 | //if there are no documents to switch to then just show the iframeContainer | 263 | //if there are no documents to switch to then just show the iframeContainer |
264 | document.getElementById("iframeContainer").style.display="block"; | 264 | document.getElementById("iframeContainer").style.display="block"; |
265 | } | 265 | } |