diff options
author | Ananya Sen | 2012-02-02 17:45:22 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-02 17:45:22 -0800 |
commit | 6890662caba94598675679f40dbb725301c93e98 (patch) | |
tree | d1e3ded939e41a2b484a4c98b48e3b3976a71c63 /js/io/document | |
parent | 476a25e8a662270dfe5b37c560e4235f02b146e4 (diff) | |
download | ninja-6890662caba94598675679f40dbb725301c93e98.tar.gz |
integrated new file dialog with the template descriptor.json and document-controller.js
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/document')
-rwxr-xr-x | js/io/document/document-controller.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index 8ce43dcc..dd62b40b 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js | |||
@@ -71,8 +71,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
71 | deserializedFromTemplate: { | 71 | deserializedFromTemplate: { |
72 | value: function() { | 72 | value: function() { |
73 | this.eventManager.addEventListener("appLoaded", this, false); | 73 | this.eventManager.addEventListener("appLoaded", this, false); |
74 | |||
75 | this.eventManager.addEventListener("executeFileOpen", this, false); | 74 | this.eventManager.addEventListener("executeFileOpen", this, false); |
75 | this.eventManager.addEventListener("executeNewFile", this, false); | ||
76 | } | 76 | } |
77 | }, | 77 | }, |
78 | 78 | ||
@@ -93,6 +93,21 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
93 | } | 93 | } |
94 | }, | 94 | }, |
95 | 95 | ||
96 | handleExecuteNewFile: { | ||
97 | value: function(event) { | ||
98 | var newFileSettings = event._event.settings || {}; | ||
99 | newFileSettings.callback = this.createNewFile; | ||
100 | newFileSettings.callbackScope = this; | ||
101 | this.application.ninja.newFileController.showNewFileDialog(newFileSettings); | ||
102 | } | ||
103 | }, | ||
104 | |||
105 | createNewFile:{ | ||
106 | value:function(newFileObj){ | ||
107 | //console.log(newFileObj); | ||
108 | } | ||
109 | }, | ||
110 | |||
96 | openFileWithURI: { | 111 | openFileWithURI: { |
97 | value: function(uriArrayObj) { | 112 | value: function(uriArrayObj) { |
98 | var uri = "", fileContent = "", response=null, filename="", fileType="js"; | 113 | var uri = "", fileContent = "", response=null, filename="", fileType="js"; |