From 008bfc67930c7eb9837be4ac0628def754b88075 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 5 Dec 2013 23:44:59 +0100 Subject: [PATCH 1/2] Fix full name edit for repetive edit fixes #6212 fixes the data attributes after edit fixes markup to successfully re-edit display name --- settings/js/users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/settings/js/users.js b/settings/js/users.js index 6222c0e70c..f19b196640 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -423,7 +423,10 @@ $(document).ready(function () { } }); input.blur(function () { - $(this).replaceWith(escapeHTML($(this).val())); + var input = $(this), + displayName = input.val(); + input.parent().parent().data('displayname', displayName); + input.replaceWith('' + escapeHTML(displayName) + ''); img.css('display', ''); }); }); From ac77218d570ca48da89ecfee7f055cf12a64015f Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 6 Dec 2013 13:53:01 +0100 Subject: [PATCH 2/2] parent().parent() -> closest() --- settings/js/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/js/users.js b/settings/js/users.js index f19b196640..5ae157b07c 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -425,7 +425,7 @@ $(document).ready(function () { input.blur(function () { var input = $(this), displayName = input.val(); - input.parent().parent().data('displayname', displayName); + input.closest('tr').attr('data-displayName', displayName); input.replaceWith('' + escapeHTML(displayName) + ''); img.css('display', ''); });