aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnanya Sen2012-02-21 09:47:05 -0800
committerAnanya Sen2012-02-21 09:47:05 -0800
commit9f80fc891b7952900dabec04877606c6c8229c61 (patch)
treea23ecc6a0483d33875d44081cc3360c3fb74202e
parent7dda611879e6232337d3f0540f8ae896c60fb898 (diff)
downloadninja-9f80fc891b7952900dabec04877606c6c8229c61.tar.gz
Revert "check cloud availability before open file picker and new file dialogs"
This reverts commit 3251315ecc22544dab50623ee5862e00dfe02302. Conflicts: js/controllers/document-controller.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
-rwxr-xr-xjs/controllers/document-controller.js20
-rwxr-xr-xjs/io/system/coreioapi.js10
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js11
3 files changed, 10 insertions, 31 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 3cd2c254..9a063280 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -100,26 +100,18 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
100 handleExecuteFileOpen: { 100 handleExecuteFileOpen: {
101 value: function(event) { 101 value: function(event) {
102 var pickerSettings = event._event.settings || {}; 102 var pickerSettings = event._event.settings || {};
103 //adding callback so that file picker can be opened after checking cloud status 103 pickerSettings.callback = this.openFileWithURI.bind(this);
104 this.application.ninja.coreIoApi.cloudAvailable(function(){ 104 pickerSettings.pickerMode = "read";
105 pickerSettings.callback = this.openFileWithURI.bind(this); 105 pickerSettings.inFileMode = true;
106 pickerSettings.pickerMode = "read"; 106 this.application.ninja.filePickerController.showFilePicker(pickerSettings);
107 pickerSettings.inFileMode = true;
108 this.application.ninja.filePickerController.showFilePicker(pickerSettings);
109 }.bind(this));
110
111 } 107 }
112 }, 108 },
113 109
114 handleExecuteNewFile: { 110 handleExecuteNewFile: {
115 value: function(event) { 111 value: function(event) {
116 var newFileSettings = event._event.settings || {}; 112 var newFileSettings = event._event.settings || {};
117 //adding callback so that new file dialog can be opened after checking cloud status 113 newFileSettings.callback = this.createNewFile.bind(this);
118 this.application.ninja.coreIoApi.cloudAvailable(function(){ 114 this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
119 newFileSettings.callback = this.createNewFile.bind(this);
120 this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
121 }.bind(this));
122
123 } 115 }
124 }, 116 },
125 117
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 1bc66532..2051da43 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -234,19 +234,18 @@ exports.CoreIoApi = Montage.create(Component, {
234 //Method to check status of I/O API, will return false if not active 234 //Method to check status of I/O API, will return false if not active
235 cloudAvailable: { 235 cloudAvailable: {
236 enumerable: false, 236 enumerable: false,
237 value: function (callback) { 237 value: function () {
238 var cloud = this.getCloudStatus(); 238 var cloud = this.getCloudStatus();
239 // 239 //
240 if (this.rootUrl && cloud.status === 200) { 240 if (this.rootUrl && cloud.status === 200) {
241 //Active 241 //Active
242 this.cloudData.name = cloud.response['name']; 242 this.cloudData.name = cloud.response['name'];
243 this.cloudData.root = cloud.response['server-root']; 243 this.cloudData.root = cloud.response['server-root'];
244 if(!!callback){callback();} 244 return true;
245 else{return true};
246 } else { 245 } else {
247 //Inactive 246 //Inactive
248 if (!this._cloudDialogOpen && this.application.ninja) { 247 if (!this._cloudDialogOpen && this.application.ninja) {
249 this.showCloudDialog(callback); 248 this.showCloudDialog();
250 } 249 }
251 return false; 250 return false;
252 } 251 }
@@ -274,7 +273,7 @@ exports.CoreIoApi = Montage.create(Component, {
274 // 273 //
275 showCloudDialog: { 274 showCloudDialog: {
276 enumerable: false, 275 enumerable: false,
277 value: function (callback) { 276 value: function () {
278 // 277 //
279 this._cloudDialogOpen = true; 278 this._cloudDialogOpen = true;
280 // 279 //
@@ -295,7 +294,6 @@ exports.CoreIoApi = Montage.create(Component, {
295 this._cloudDialogComponents.dialog.element = popup; 294 this._cloudDialogComponents.dialog.element = popup;
296 this._cloudDialogComponents.dialog.needsDraw = true; 295 this._cloudDialogComponents.dialog.needsDraw = true;
297 this._cloudDialogComponents.dialog.element.style.opacity = 0; 296 this._cloudDialogComponents.dialog.element.style.opacity = 0;
298 this._cloudDialogComponents.dialog.callback = callback;
299 // 297 //
300 this._cloudDialogComponents.dialog.addEventListener('firstDraw', this, false); 298 this._cloudDialogComponents.dialog.addEventListener('firstDraw', this, false);
301 } 299 }
diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js
index 34393db5..d2e82662 100755
--- a/js/io/ui/cloudpopup.reel/cloudpopup.js
+++ b/js/io/ui/cloudpopup.reel/cloudpopup.js
@@ -23,12 +23,6 @@ exports.CloudPopup = Montage.create(Component, {
23 }, 23 },
24 //////////////////////////////////////////////////////////////////// 24 ////////////////////////////////////////////////////////////////////
25 // 25 //
26 callback:{
27 writable:true,
28 enumerable:true,
29 value:null
30 },
31 //
32 components: { 26 components: {
33 enumerable: false, 27 enumerable: false,
34 value: {test_btn: null, ok_btn: null, cancel_btn: null, download_btn: null, status: null, url: null} 28 value: {test_btn: null, ok_btn: null, cancel_btn: null, download_btn: null, status: null, url: null}
@@ -131,10 +125,6 @@ exports.CloudPopup = Montage.create(Component, {
131 value: function() { 125 value: function() {
132 // 126 //
133 this.application.ninja.coreIoApi.hideCloudDialog(); 127 this.application.ninja.coreIoApi.hideCloudDialog();
134 this.application.ninja.coreIoApi._cloudDialogOpen=false;
135 if(!!this.callback){
136 this.callback();
137 }
138 } 128 }
139 }, 129 },
140 //////////////////////////////////////////////////////////////////// 130 ////////////////////////////////////////////////////////////////////
@@ -145,7 +135,6 @@ exports.CloudPopup = Montage.create(Component, {
145 // 135 //
146 this.application.ninja.coreIoApi.rootUrl = null; 136 this.application.ninja.coreIoApi.rootUrl = null;
147 this.application.ninja.coreIoApi.hideCloudDialog(); 137 this.application.ninja.coreIoApi.hideCloudDialog();
148 this.application.ninja.coreIoApi._cloudDialogOpen=false;
149 } 138 }
150 } 139 }
151 //////////////////////////////////////////////////////////////////// 140 ////////////////////////////////////////////////////////////////////