diff options
author | Valerio Virgillito | 2012-03-08 13:39:11 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-03-08 13:39:11 -0800 |
commit | 5940b22e01de4fc36e5c5de5f3ed074f08fadb07 (patch) | |
tree | 72a5592ef65b3238b31f0e9954b2ad8d1778eeac /js/controllers | |
parent | 9b006acf1f6c2be5abc54f94a8bee7e684f106f9 (diff) | |
parent | 130cd6d4b99c9db344ec0ab44a54a59d11b31d2f (diff) | |
download | ninja-5940b22e01de4fc36e5c5de5f3ed074f08fadb07.tar.gz |
Merge pull request #104 from ananyasen/integration-candidate
IKNINJA-1270: fixed browser crashing when you close a document while playing a video
Diffstat (limited to 'js/controllers')
-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 194496a6..a8056519 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -336,14 +336,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
336 | nextDocumentIndex = closeDocumentIndex - 1; | 336 | nextDocumentIndex = closeDocumentIndex - 1; |
337 | } | 337 | } |
338 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 338 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
339 | if(typeof this.activeDocument.stopVideos !== "undefined"){doc.stopVideos();} | ||
339 | this._removeDocumentView(doc.container); | 340 | this._removeDocumentView(doc.container); |
340 | }else if(this._documents.length === 0){ | 341 | }else if(this._documents.length === 0){ |
342 | if(typeof this.activeDocument.pauseAndStopVideos !== "undefined"){ | ||
343 | this.activeDocument.pauseAndStopVideos(); | ||
344 | } | ||
341 | this.activeDocument = null; | 345 | this.activeDocument = null; |
342 | this._removeDocumentView(doc.container); | 346 | this._removeDocumentView(doc.container); |
343 | this.application.ninja.stage.stageView.hideRulers(); | 347 | this.application.ninja.stage.stageView.hideRulers(); |
344 | document.getElementById("iframeContainer").style.display="block"; | 348 | document.getElementById("iframeContainer").style.display="block"; |
345 | 349 | ||
346 | this.application.ninja.stage.hideCanvas(true); | 350 | this.application.ninja.stage.hideCanvas(true); |
351 | }else{//closing inactive document tab - just clear DOM | ||
352 | if(typeof doc.pauseAndStopVideos !== "undefined"){ | ||
353 | doc.pauseAndStopVideos(); | ||
354 | } | ||
355 | this._removeDocumentView(doc.container); | ||
347 | } | 356 | } |
348 | 357 | ||
349 | NJevent("closeDocument", doc.uri); | 358 | NJevent("closeDocument", doc.uri); |