From 8f3aa15eb48077692a81f809efbe2de234b3ac6b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 29 Sep 2013 11:25:08 +0000 Subject: [PATCH] fix changing email, pandora.validateNewEmail has to pass value to callback --- static/js/autovalidate.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/autovalidate.js b/static/js/autovalidate.js index 1f7b6a0c..3d9ac19a 100644 --- a/static/js/autovalidate.js +++ b/static/js/autovalidate.js @@ -49,20 +49,23 @@ pandora.validateCode = function(value, callback) { pandora.validateNewEmail = function(value, callback) { value == pandora.user.email ? callback({ message: '', - valid: true + valid: true, + value: value }) : Ox.isValidEmail(value) ? pandora.api.findUser({ key: 'email', value: value, operator: '==' }, function(result) { callback({ - message: Ox._('E-Mail Address already exists'), - valid: !result.data.users.length + message: !!result.data.users.length ? Ox._('E-Mail Address already exists') : '', + valid: !result.data.users.length, + value: value }); }) : callback({ message: value.length ? Ox._('Invalid e-mail address') : '', // message: (!value.length ? 'Missing' : 'Invalid') + ' e-mail address', - valid: false + valid: false, + value: value }); };