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 ++++++ js/stage/stage-view.reel/stage-view.js | 2 ++ 2 files changed, 8 insertions(+) (limited to 'js') 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)){ diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index dc9980f0..c6427317 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -149,6 +149,8 @@ exports.StageView = Montage.create(Component, { // appDelegateModule.MyAppDelegate.onSetActiveDocument(); } + NJevent("switchDocument"); + } }, -- cgit v1.2.3