From a715b133ffcda328f4dbc67e9490ccedfe4c0f77 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 16 Mar 2011 00:23:34 -0700 Subject: [PATCH] Extended profile - fix regression whereby if there was only one item, you could still delete it! --- plugins/ExtendedProfile/js/profiledetail.js | 10 +++++----- .../ExtendedProfile/profiledetailsettingsaction.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/ExtendedProfile/js/profiledetail.js b/plugins/ExtendedProfile/js/profiledetail.js index 7960cee83f..f475046385 100644 --- a/plugins/ExtendedProfile/js/profiledetail.js +++ b/plugins/ExtendedProfile/js/profiledetail.js @@ -68,19 +68,17 @@ SN_EXTENDED.removeRow = function() { var div = $(this).closest('div'); var id = $(div).attr('id'); var cls = $(div).attr('class'); - var cnt = SN_EXTENDED.rowCount(cls); - var that = this; $("#confirm-dialog").dialog({ buttons : { "Confirm" : function() { + $(this).dialog("close"); var target = $(that).closest('tr'); target.fadeOut("slow", function() { - $(that).remove(); + $(target).remove(); + SN_EXTENDED.reorder(cls); }); - SN_EXTENDED.reorder(cls); - $(this).dialog("close"); }, "Cancel" : function() { $(this).dialog("close"); @@ -88,6 +86,8 @@ SN_EXTENDED.removeRow = function() { } }); + var cnt = SN_EXTENDED.rowCount(cls); + if (cnt > 1) { $("#confirm-dialog").dialog("open"); } diff --git a/plugins/ExtendedProfile/profiledetailsettingsaction.php b/plugins/ExtendedProfile/profiledetailsettingsaction.php index b0590f7316..01a8fa9c7b 100644 --- a/plugins/ExtendedProfile/profiledetailsettingsaction.php +++ b/plugins/ExtendedProfile/profiledetailsettingsaction.php @@ -60,7 +60,7 @@ class ProfileDetailSettingsAction extends ProfileSettingsAction // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->show_form( + $this->showForm( _m( 'There was a problem with your session token. ' . 'Try again, please.' -- 2.39.5