From b354ea65f7c53ce05aff6a204853e666f084950f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 1 Feb 2012 13:56:49 -0800 Subject: Adding cancel functionality to cloud popup Added the functionality to the cloud pupup cancel button to set the rootURL to null if selected, ok button will allow the value to remain as last input. Test button tests the URL, and therefore set it, but does not handling closing the dialog. --- js/io/ui/cloudpopup.reel/cloudpopup.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index e8558179..7f494dcf 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js @@ -51,6 +51,9 @@ exports.CloudPopup = Montage.create(Component, { value: function() { // this.testConnection(); + if (this.application.ninja.coreIoApi.cloudAvailable()) { + this.closeDialog(); + } } }, //////////////////////////////////////////////////////////////////// @@ -62,7 +65,7 @@ exports.CloudPopup = Montage.create(Component, { this.components.test_btn.addEventListener('click', this.testConnection.bind(this), false); // this.components.ok_btn.addEventListener('click', this.closeDialog.bind(this), false); - this.components.cancel_btn.addEventListener('click', this.closeDialog.bind(this), false); + this.components.cancel_btn.addEventListener('click', this.cancelDialog.bind(this), false); } }, //////////////////////////////////////////////////////////////////// @@ -90,6 +93,16 @@ exports.CloudPopup = Montage.create(Component, { // this.application.ninja.coreIoApi.hideCloudDialog(); } + }, + //////////////////////////////////////////////////////////////////// + // + cancelDialog: { + enumerable: false, + value: function() { + // + this.application.ninja.coreIoApi.rootUrl = null; + this.application.ninja.coreIoApi.hideCloudDialog(); + } } //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// -- cgit v1.2.3