diff options
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 1c9d9d59..843db87c 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -169,6 +169,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
169 | value:function(doc){ | 169 | value:function(doc){ |
170 | var response = doc || null;//default just for testing | 170 | var response = doc || null;//default just for testing |
171 | if(!!response && response.success && (response.status!== 500) && !!response.uri){ | 171 | if(!!response && response.success && (response.status!== 500) && !!response.uri){ |
172 | this.creatingNewFile = true;//flag for timeline to identify new file flow | ||
172 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); | 173 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); |
173 | }else if(!!response && !response.success){ | 174 | }else if(!!response && !response.success){ |
174 | //Todo: restrict directory path to the sandbox, in the dialog itself | 175 | //Todo: restrict directory path to the sandbox, in the dialog itself |
@@ -196,6 +197,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
196 | value:function(response){ | 197 | value:function(response){ |
197 | //TODO: Add UI to handle error codes, shouldn't be alert windows | 198 | //TODO: Add UI to handle error codes, shouldn't be alert windows |
198 | if(!!response && (response.status === 204)) { | 199 | if(!!response && (response.status === 204)) { |
200 | |||
201 | if((typeof this.creatingNewFile === 'undefined') || (this.creatingNewFile !== true)){//not from new file flow | ||
202 | this.creatingNewFile = false; | ||
203 | } | ||
204 | |||
199 | //Sending full response object | 205 | //Sending full response object |
200 | this.openDocument(response); | 206 | this.openDocument(response); |
201 | } else if (!!response && (response.status === 404)){ | 207 | } else if (!!response && (response.status === 404)){ |