From 250420d8c6154172b27fe53aff30e78c227e8a67 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 7 Mar 2012 14:26:37 -0800 Subject: minor fixes Signed-off-by: Ananya Sen --- js/controllers/document-controller.js | 12 ++++++------ js/controllers/selection-controller.js | 14 -------------- 2 files changed, 6 insertions(+), 20 deletions(-) (limited to 'js/controllers') 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, //////////////////////////////////////////////////////////////////// handleExecuteFileClose:{ value: function(event) { - if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ this.closeDocument(this.activeDocument.uuid); } } @@ -372,11 +372,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, nextDocumentIndex = closeDocumentIndex - 1; } this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); - doc.stopVideos(); + if(typeof this.activeDocument.stopVideos !== "undefined"){doc.stopVideos();} this._removeDocumentView(doc.container); }else if(this._documents.length === 0){ - if(typeof this.activeDocument.pauseVideos !== "undefined"){ - this.activeDocument.pauseVideos(true); + if(typeof this.activeDocument.pauseAndStopVideos !== "undefined"){ + this.activeDocument.pauseAndStopVideos(); } this.activeDocument = null; this._removeDocumentView(doc.container); @@ -385,8 +385,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.application.ninja.stage.hideCanvas(true); }else{//closing inactive document tab - just clear DOM - if(typeof doc.pauseVideos !== "undefined"){ - doc.pauseVideos(true); + if(typeof doc.pauseAndStopVideos !== "undefined"){ + doc.pauseAndStopVideos(); } this._removeDocumentView(doc.container); } 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, { this._isDocument = false; } NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); - - this._selectionContainer = this.application.ninja.currentSelectedContainer; - } - } - }, - - handleCloseDocument:{ - value: function() { - //clear selections if all documents are closed - if(this.application.ninja.documentController._documents.length === 0){ - this._selectedItems.length =0; - this.application.ninja.selectedElements.length =0; - this._isDocument = true; - NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); } } }, -- cgit v1.2.3