From 8020dc6e99e3bf0aad605f66a175bc2245da534b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 6 Mar 2012 23:53:21 -0800 Subject: added close file menu item Signed-off-by: Ananya Sen --- js/controllers/document-controller.js | 11 ++++++++++- js/data/menu-data.js | 6 ++++++ js/document/html-document.js | 1 - 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index de080167..ca3cd585 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -60,6 +60,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.eventManager.addEventListener("executeSave", this, false); this.eventManager.addEventListener("executeSaveAs", this, false); this.eventManager.addEventListener("executeSaveAll", this, false); + this.eventManager.addEventListener("executeFileClose", this, false); this.eventManager.addEventListener("styleSheetDirty", this, false); @@ -162,7 +163,15 @@ var DocumentController = exports.DocumentController = Montage.create(Component, } } }, - + //////////////////////////////////////////////////////////////////// + handleExecuteFileClose:{ + value: function(event) { + if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + this.closeDocument(this.activeDocument.uuid); + } + } + }, + //////////////////////////////////////////////////////////////////// // fileSaveResult: { value: function (result) { diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 52710b3a..40512f5d 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -30,6 +30,12 @@ exports.MenuData = Montage.create( Montage, { "enabled": true, "action": "executeFileOpen" }, + { + "displayText" : "Close File", + "hasSubMenu" : false, + "enabled": true, + "action": "executeFileClose" + }, { "displayText" : "", "separator": true diff --git a/js/document/html-document.js b/js/document/html-document.js index 9670e0c4..83f91c19 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -894,7 +894,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { /** * remove the video src on closing the document, so that the browser does not keep downloading the media data, if the tag does not get garbage collected - *removeSrc : boolean to remove the src if the video... set only in the close document flow */ stopVideos:{ value:function(){ -- cgit v1.2.3