Extended profile - fix regression whereby if there was only one item, you could still delete it!
This commit is contained in:
parent
d51625ab3d
commit
a715b133ff
@ -68,19 +68,17 @@ SN_EXTENDED.removeRow = function() {
|
|||||||
var div = $(this).closest('div');
|
var div = $(this).closest('div');
|
||||||
var id = $(div).attr('id');
|
var id = $(div).attr('id');
|
||||||
var cls = $(div).attr('class');
|
var cls = $(div).attr('class');
|
||||||
var cnt = SN_EXTENDED.rowCount(cls);
|
|
||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
$("#confirm-dialog").dialog({
|
$("#confirm-dialog").dialog({
|
||||||
buttons : {
|
buttons : {
|
||||||
"Confirm" : function() {
|
"Confirm" : function() {
|
||||||
|
$(this).dialog("close");
|
||||||
var target = $(that).closest('tr');
|
var target = $(that).closest('tr');
|
||||||
target.fadeOut("slow", function() {
|
target.fadeOut("slow", function() {
|
||||||
$(that).remove();
|
$(target).remove();
|
||||||
});
|
|
||||||
SN_EXTENDED.reorder(cls);
|
SN_EXTENDED.reorder(cls);
|
||||||
$(this).dialog("close");
|
});
|
||||||
},
|
},
|
||||||
"Cancel" : function() {
|
"Cancel" : function() {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
@ -88,6 +86,8 @@ SN_EXTENDED.removeRow = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var cnt = SN_EXTENDED.rowCount(cls);
|
||||||
|
|
||||||
if (cnt > 1) {
|
if (cnt > 1) {
|
||||||
$("#confirm-dialog").dialog("open");
|
$("#confirm-dialog").dialog("open");
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class ProfileDetailSettingsAction extends ProfileSettingsAction
|
|||||||
// CSRF protection
|
// CSRF protection
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (!$token || $token != common_session_token()) {
|
if (!$token || $token != common_session_token()) {
|
||||||
$this->show_form(
|
$this->showForm(
|
||||||
_m(
|
_m(
|
||||||
'There was a problem with your session token. '
|
'There was a problem with your session token. '
|
||||||
. 'Try again, please.'
|
. 'Try again, please.'
|
||||||
|
Loading…
Reference in New Issue
Block a user