From 9dabdd11b7fc8a042e139457748547ffe2232468 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 24 Feb 2012 12:58:12 -0800 Subject: - added flag for timeline to identify new file flow - added switchDocument event for timeline Signed-off-by: Ananya Sen Signed-off-by: Jonathan Duran --- js/controllers/document-controller.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/controllers') 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, value:function(doc){ var response = doc || null;//default just for testing if(!!response && response.success && (response.status!== 500) && !!response.uri){ + this.creatingNewFile = true;//flag for timeline to identify new file flow this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); }else if(!!response && !response.success){ //Todo: restrict directory path to the sandbox, in the dialog itself @@ -196,6 +197,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value:function(response){ //TODO: Add UI to handle error codes, shouldn't be alert windows if(!!response && (response.status === 204)) { + + if((typeof this.creatingNewFile === 'undefined') || (this.creatingNewFile !== true)){//not from new file flow + this.creatingNewFile = false; + } + //Sending full response object this.openDocument(response); } else if (!!response && (response.status === 404)){ -- cgit v1.2.3