From d6e7b15e85ae5f0b68b3dcf0d4dde47dc46c37ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 14 Jan 2011 22:14:31 +0100 Subject: [PATCH] Add function that deletes a profile field. --- src/main/resources/static/javascript/sone.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 3c229e0..7ab0a76 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -862,6 +862,20 @@ function showNotificationDetails(notificationId) { $("#sone .notification#" + notificationId + " .short-text").hide(); } +/** + * Deletes the field with the given ID from the profile. + * + * @param fieldId + * The ID of the field to delete + */ +function deleteProfileField(fieldId) { + $.getJSON("deleteProfileField.ajax", {"formPassword": getFormPassword(), "field": fieldId}, function(data, textStatus) { + if (data && data.success) { + $("#sone .profile-field#" + data.field.id).slideUp(); + } + }); +} + // // EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE // -- 2.7.4