diff options
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index e29148c9..de080167 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -363,14 +363,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
363 | nextDocumentIndex = closeDocumentIndex - 1; | 363 | nextDocumentIndex = closeDocumentIndex - 1; |
364 | } | 364 | } |
365 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 365 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
366 | doc.stopVideos(); | ||
366 | this._removeDocumentView(doc.container); | 367 | this._removeDocumentView(doc.container); |
367 | }else if(this._documents.length === 0){ | 368 | }else if(this._documents.length === 0){ |
369 | if(typeof this.activeDocument.pauseVideos !== "undefined"){ | ||
370 | this.activeDocument.pauseVideos(true); | ||
371 | } | ||
368 | this.activeDocument = null; | 372 | this.activeDocument = null; |
369 | this._removeDocumentView(doc.container); | 373 | this._removeDocumentView(doc.container); |
370 | this.application.ninja.stage.stageView.hideRulers(); | 374 | this.application.ninja.stage.stageView.hideRulers(); |
371 | document.getElementById("iframeContainer").style.display="block"; | 375 | document.getElementById("iframeContainer").style.display="block"; |
372 | 376 | ||
373 | this.application.ninja.stage.hideCanvas(true); | 377 | this.application.ninja.stage.hideCanvas(true); |
378 | }else{//closing inactive document tab - just clear DOM | ||
379 | if(typeof doc.pauseVideos !== "undefined"){ | ||
380 | doc.pauseVideos(true); | ||
381 | } | ||
382 | this._removeDocumentView(doc.container); | ||
374 | } | 383 | } |
375 | 384 | ||
376 | NJevent("closeDocument", doc.uri); | 385 | NJevent("closeDocument", doc.uri); |