From e646d6f2e1db5986d31b15c2e6fd8f3aa8665aee Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 7 Mar 2016 16:58:03 +0100 Subject: [PATCH] Feature #4363: Fix user auth dialog --- .../app/tabs/users-tab/dialogs/auth-driver.js | 31 ++++++++++--------- .../users-tab/dialogs/auth-driver/html.hbs | 6 ++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver.js b/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver.js index 61210a1cc2..aeb43eb927 100644 --- a/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver.js +++ b/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver.js @@ -70,25 +70,26 @@ define(function(require) { this.userCreation.setup(context); - context.foundation('abide', 'reflow'); - context.off('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form'); - context.off('valid.fndtn.abide', '#' + DIALOG_ID + 'Form'); + Foundation.reflow(context, 'abide'); - context.on('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) { - Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed.")); - }).on('valid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) { - var inputs = that.userCreation.retrieve(context); + $('#' + DIALOG_ID + 'Form') + .on('forminvalid.zf.abide', function(ev, frm) { + Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed.")); + }) + .on('formvalid.zf.abide', function(ev, frm) { + var inputs = that.userCreation.retrieve(context); - var selElems = Sunstone.getDataTable(TAB_ID).elements(); + var selElems = Sunstone.getDataTable(TAB_ID).elements(); - Sunstone.runAction('User.chauth', selElems, inputs.auth_driver); + Sunstone.runAction('User.chauth', selElems, inputs.auth_driver); - Sunstone.getDialog(DIALOG_ID).hide(); - Sunstone.getDialog(DIALOG_ID).reset(); - Sunstone.runAction('User.refresh'); - - return false; - }); + Sunstone.getDialog(DIALOG_ID).hide(); + Sunstone.getDialog(DIALOG_ID).reset(); + Sunstone.runAction('User.refresh'); + }) + .on("submit", function(ev) { + ev.preventDefault(); + }); return false; } diff --git a/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver/html.hbs b/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver/html.hbs index 5c13a9406a..e824f6b374 100644 --- a/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver/html.hbs +++ b/src/sunstone/public/app/tabs/users-tab/dialogs/auth-driver/html.hbs @@ -14,7 +14,7 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -