aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js12
-rwxr-xr-xjs/controllers/selection-controller.js14
2 files changed, 6 insertions, 20 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index ca3cd585..87e93465 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -166,7 +166,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
166 //////////////////////////////////////////////////////////////////// 166 ////////////////////////////////////////////////////////////////////
167 handleExecuteFileClose:{ 167 handleExecuteFileClose:{
168 value: function(event) { 168 value: function(event) {
169 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ 169 if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){
170 this.closeDocument(this.activeDocument.uuid); 170 this.closeDocument(this.activeDocument.uuid);
171 } 171 }
172 } 172 }
@@ -372,11 +372,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
372 nextDocumentIndex = closeDocumentIndex - 1; 372 nextDocumentIndex = closeDocumentIndex - 1;
373 } 373 }
374 this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); 374 this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]);
375 doc.stopVideos(); 375 if(typeof this.activeDocument.stopVideos !== "undefined"){doc.stopVideos();}
376 this._removeDocumentView(doc.container); 376 this._removeDocumentView(doc.container);
377 }else if(this._documents.length === 0){ 377 }else if(this._documents.length === 0){
378 if(typeof this.activeDocument.pauseVideos !== "undefined"){ 378 if(typeof this.activeDocument.pauseAndStopVideos !== "undefined"){
379 this.activeDocument.pauseVideos(true); 379 this.activeDocument.pauseAndStopVideos();
380 } 380 }
381 this.activeDocument = null; 381 this.activeDocument = null;
382 this._removeDocumentView(doc.container); 382 this._removeDocumentView(doc.container);
@@ -385,8 +385,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
385 385
386 this.application.ninja.stage.hideCanvas(true); 386 this.application.ninja.stage.hideCanvas(true);
387 }else{//closing inactive document tab - just clear DOM 387 }else{//closing inactive document tab - just clear DOM
388 if(typeof doc.pauseVideos !== "undefined"){ 388 if(typeof doc.pauseAndStopVideos !== "undefined"){
389 doc.pauseVideos(true); 389 doc.pauseAndStopVideos();
390 } 390 }
391 this._removeDocumentView(doc.container); 391 this._removeDocumentView(doc.container);
392 } 392 }
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index eff9c91a..c713b6e5 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -100,20 +100,6 @@ exports.SelectionController = Montage.create(Component, {
100 this._isDocument = false; 100 this._isDocument = false;
101 } 101 }
102 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 102 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
103
104 this._selectionContainer = this.application.ninja.currentSelectedContainer;
105 }
106 }
107 },
108
109 handleCloseDocument:{
110 value: function() {
111 //clear selections if all documents are closed
112 if(this.application.ninja.documentController._documents.length === 0){
113 this._selectedItems.length =0;
114 this.application.ninja.selectedElements.length =0;
115 this._isDocument = true;
116 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
117 } 103 }
118 } 104 }
119 }, 105 },