From f0752d7ba1bb879803c97e6f6519f4d2400932ab Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 5 Feb 2016 10:27:18 +0100 Subject: [PATCH] Allow to delete the email address in user management --- settings/js/users/users.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 151ab6cdecc..306e3952e53 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -732,24 +732,20 @@ $(document).ready(function () { .focus() .keypress(function (event) { if (event.keyCode === 13) { - if ($(this).val().length > 0) { - $tr.data('mailAddress', $input.val()); - $input.blur(); - $.ajax({ - type: 'PUT', - url: OC.generateUrl('/settings/users/{id}/mailAddress', {id: uid}), - data: { - mailAddress: $(this).val() - } - }).fail(function (result) { - OC.Notification.show(result.responseJSON.data.message); - // reset the values - $tr.data('mailAddress', mailAddress); - $tr.children('.mailAddress').children('span').text(mailAddress); - }); - } else { - $input.blur(); - } + $tr.data('mailAddress', $input.val()); + $input.blur(); + $.ajax({ + type: 'PUT', + url: OC.generateUrl('/settings/users/{id}/mailAddress', {id: uid}), + data: { + mailAddress: $(this).val() + } + }).fail(function (result) { + OC.Notification.show(result.responseJSON.data.message); + // reset the values + $tr.data('mailAddress', mailAddress); + $tr.children('.mailAddress').children('span').text(mailAddress); + }); } }) .blur(function () { -- 2.39.5