From 9f80fc891b7952900dabec04877606c6c8229c61 Mon Sep 17 00:00:00 2001
From: Ananya Sen
Date: Tue, 21 Feb 2012 09:47:05 -0800
Subject: 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>
---
 js/controllers/document-controller.js  | 20 ++++++--------------
 js/io/system/coreioapi.js              | 10 ++++------
 js/io/ui/cloudpopup.reel/cloudpopup.js | 11 -----------
 3 files changed, 10 insertions(+), 31 deletions(-)

(limited to 'js')

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,
     handleExecuteFileOpen: {
         value: function(event) {
             var pickerSettings = event._event.settings || {};
-            //adding callback so that file picker can be opened after checking cloud status
-            this.application.ninja.coreIoApi.cloudAvailable(function(){
-                pickerSettings.callback = this.openFileWithURI.bind(this);
-                pickerSettings.pickerMode = "read";
-                pickerSettings.inFileMode = true;
-                this.application.ninja.filePickerController.showFilePicker(pickerSettings);
-            }.bind(this));
-
+            pickerSettings.callback = this.openFileWithURI.bind(this);
+            pickerSettings.pickerMode = "read";
+            pickerSettings.inFileMode = true;
+            this.application.ninja.filePickerController.showFilePicker(pickerSettings);
         }
     },
 
     handleExecuteNewFile: {
             value: function(event) {
                 var newFileSettings = event._event.settings || {};
-                //adding callback so that new file dialog can be opened after checking cloud status
-                this.application.ninja.coreIoApi.cloudAvailable(function(){
-                    newFileSettings.callback = this.createNewFile.bind(this);
-                    this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
-                }.bind(this));
-
+                newFileSettings.callback = this.createNewFile.bind(this);
+                this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
             }
     },
 	
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, {
     //Method to check status of I/O API, will return false if not active
 	cloudAvailable: {
 		enumerable: false,
-		value: function (callback) {
+		value: function () {
 			var cloud = this.getCloudStatus();
 			//
 			if (this.rootUrl && cloud.status === 200) {
 				//Active
 				this.cloudData.name = cloud.response['name'];
 				this.cloudData.root = cloud.response['server-root'];
-                if(!!callback){callback();}
-				else{return true};
+				return true;
 			} else {
 				//Inactive
 				if (!this._cloudDialogOpen && this.application.ninja) {
-					this.showCloudDialog(callback);
+					this.showCloudDialog();
 				}
 				return false;
 			}
@@ -274,7 +273,7 @@ exports.CoreIoApi = Montage.create(Component, {
     //
     showCloudDialog: {
     	enumerable: false,
-		value: function (callback) {
+		value: function () {
 			//
 			this._cloudDialogOpen = true;
 			//
@@ -295,7 +294,6 @@ exports.CoreIoApi = Montage.create(Component, {
     		this._cloudDialogComponents.dialog.element = popup;
     		this._cloudDialogComponents.dialog.needsDraw = true;
     		this._cloudDialogComponents.dialog.element.style.opacity = 0;
-            this._cloudDialogComponents.dialog.callback = callback;
     		//
     		this._cloudDialogComponents.dialog.addEventListener('firstDraw', this, false);
 		}
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, {
     },
     ////////////////////////////////////////////////////////////////////
     //
-    callback:{
-        writable:true,
-        enumerable:true,
-        value:null
-    },
-    //
     components: {
     	enumerable: false,
     	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, {
     	value: function() {
     		//
     		this.application.ninja.coreIoApi.hideCloudDialog();
-            this.application.ninja.coreIoApi._cloudDialogOpen=false;
-            if(!!this.callback){
-                this.callback();
-            }
     	}
     },
     ////////////////////////////////////////////////////////////////////
@@ -145,7 +135,6 @@ exports.CloudPopup = Montage.create(Component, {
     		//
     		this.application.ninja.coreIoApi.rootUrl = null;
     		this.application.ninja.coreIoApi.hideCloudDialog();
-            this.application.ninja.coreIoApi._cloudDialogOpen=false;
     	}
     }
     ////////////////////////////////////////////////////////////////////
-- 
cgit v1.2.3