diff options
author | Ananya Sen | 2012-02-24 12:05:16 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-24 12:05:16 -0800 |
commit | 85d59d57ea556b114c5cad9b2ec67ccc27119380 (patch) | |
tree | e859b98aa18c80b13d33872b65b7aa10b06eecdf /js | |
parent | a23455a887982d306d794b6afca497259cfa7f4a (diff) | |
download | ninja-85d59d57ea556b114c5cad9b2ec67ccc27119380.tar.gz |
- added flag for timeline to identify new file flow
- added switchDocument event for timeline
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/document-controller.js | 6 | ||||
-rwxr-xr-x | js/stage/stage-view.reel/stage-view.js | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index e221df68..714d1404 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -195,6 +195,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
195 | value:function(doc){ | 195 | value:function(doc){ |
196 | var response = doc || null;//default just for testing | 196 | var response = doc || null;//default just for testing |
197 | if(!!response && response.success && (response.status!== 500) && !!response.uri){ | 197 | if(!!response && response.success && (response.status!== 500) && !!response.uri){ |
198 | this.creatingNewFile = true;//flag for timeline to identify new file flow | ||
198 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); | 199 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); |
199 | }else if(!!response && !response.success){ | 200 | }else if(!!response && !response.success){ |
200 | //Todo: restrict directory path to the sandbox, in the dialog itself | 201 | //Todo: restrict directory path to the sandbox, in the dialog itself |
@@ -222,6 +223,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
222 | value:function(response){ | 223 | value:function(response){ |
223 | //TODO: Add UI to handle error codes, shouldn't be alert windows | 224 | //TODO: Add UI to handle error codes, shouldn't be alert windows |
224 | if(!!response && (response.status === 204)) { | 225 | if(!!response && (response.status === 204)) { |
226 | |||
227 | if((typeof this.creatingNewFile === 'undefined') || (this.creatingNewFile !== true)){//not from new file flow | ||
228 | this.creatingNewFile = false; | ||
229 | } | ||
230 | |||
225 | //Sending full response object | 231 | //Sending full response object |
226 | this.openDocument(response); | 232 | this.openDocument(response); |
227 | } else if (!!response && (response.status === 404)){ | 233 | } else if (!!response && (response.status === 404)){ |
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index ab02661d..91047e51 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js | |||
@@ -146,6 +146,8 @@ exports.StageView = Montage.create(Component, { | |||
146 | // appDelegateModule.MyAppDelegate.onSetActiveDocument(); | 146 | // appDelegateModule.MyAppDelegate.onSetActiveDocument(); |
147 | } | 147 | } |
148 | 148 | ||
149 | NJevent("switchDocument"); | ||
150 | |||
149 | } | 151 | } |
150 | }, | 152 | }, |
151 | 153 | ||