From 3251315ecc22544dab50623ee5862e00dfe02302 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 20 Feb 2012 15:15:37 -0800 Subject: check cloud availability before open file picker and new file dialogs Signed-off-by: Ananya Sen --- js/io/system/coreioapi.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/io/system/coreioapi.js') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 2051da43..1bc66532 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -234,18 +234,19 @@ exports.CoreIoApi = Montage.create(Component, { //Method to check status of I/O API, will return false if not active cloudAvailable: { enumerable: false, - value: function () { + value: function (callback) { var cloud = this.getCloudStatus(); // if (this.rootUrl && cloud.status === 200) { //Active this.cloudData.name = cloud.response['name']; this.cloudData.root = cloud.response['server-root']; - return true; + if(!!callback){callback();} + else{return true}; } else { //Inactive if (!this._cloudDialogOpen && this.application.ninja) { - this.showCloudDialog(); + this.showCloudDialog(callback); } return false; } @@ -273,7 +274,7 @@ exports.CoreIoApi = Montage.create(Component, { // showCloudDialog: { enumerable: false, - value: function () { + value: function (callback) { // this._cloudDialogOpen = true; // @@ -294,6 +295,7 @@ 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); } -- cgit v1.2.3