aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-03-06 23:53:21 -0800
committerAnanya Sen2012-03-06 23:53:21 -0800
commit8020dc6e99e3bf0aad605f66a175bc2245da534b (patch)
tree12d4a659a6cf214dcabe41a5b9d4c3f1d9f4f212 /js
parent5afc582a1ae537f1e30113394780f1c8eec58f89 (diff)
downloadninja-8020dc6e99e3bf0aad605f66a175bc2245da534b.tar.gz
added close file menu item
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js11
-rwxr-xr-xjs/data/menu-data.js6
-rwxr-xr-xjs/document/html-document.js1
3 files changed, 16 insertions, 2 deletions
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,
60 this.eventManager.addEventListener("executeSave", this, false); 60 this.eventManager.addEventListener("executeSave", this, false);
61 this.eventManager.addEventListener("executeSaveAs", this, false); 61 this.eventManager.addEventListener("executeSaveAs", this, false);
62 this.eventManager.addEventListener("executeSaveAll", this, false); 62 this.eventManager.addEventListener("executeSaveAll", this, false);
63 this.eventManager.addEventListener("executeFileClose", this, false);
63 64
64 this.eventManager.addEventListener("styleSheetDirty", this, false); 65 this.eventManager.addEventListener("styleSheetDirty", this, false);
65 66
@@ -162,7 +163,15 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
162 } 163 }
163 } 164 }
164 }, 165 },
165 166 ////////////////////////////////////////////////////////////////////
167 handleExecuteFileClose:{
168 value: function(event) {
169 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
170 this.closeDocument(this.activeDocument.uuid);
171 }
172 }
173 },
174 ////////////////////////////////////////////////////////////////////
166 // 175 //
167 fileSaveResult: { 176 fileSaveResult: {
168 value: function (result) { 177 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
@@ -31,6 +31,12 @@ exports.MenuData = Montage.create( Montage, {
31 "action": "executeFileOpen" 31 "action": "executeFileOpen"
32 }, 32 },
33 { 33 {
34 "displayText" : "Close File",
35 "hasSubMenu" : false,
36 "enabled": true,
37 "action": "executeFileClose"
38 },
39 {
34 "displayText" : "", 40 "displayText" : "",
35 "separator": true 41 "separator": true
36 }, 42 },
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, {
894 894
895 /** 895 /**
896 * 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 896 * 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
897 *removeSrc : boolean to remove the src if the video... set only in the close document flow
898 */ 897 */
899 stopVideos:{ 898 stopVideos:{
900 value:function(){ 899 value:function(){