aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJonathan Duran2012-02-24 12:58:12 -0800
committerJonathan Duran2012-02-24 12:58:12 -0800
commit9dabdd11b7fc8a042e139457748547ffe2232468 (patch)
treecc8fbb488f1302cc20d61202fe5f80340cdc38b4 /js
parent2b2bf67d1b7928e4e9d8dde5abf78618b9a1c9ce (diff)
downloadninja-9dabdd11b7fc8a042e139457748547ffe2232468.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> Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js6
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js2
2 files changed, 8 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)){
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, {
149 // appDelegateModule.MyAppDelegate.onSetActiveDocument(); 149 // appDelegateModule.MyAppDelegate.onSetActiveDocument();
150 } 150 }
151 151
152 NJevent("switchDocument");
153
152 } 154 }
153 }, 155 },
154 156