Extended profile - fix regression whereby if there was only one item, you could still delete it!

This commit is contained in:
Zach Copley
2011-03-16 00:23:34 -07:00
parent d51625ab3d
commit a715b133ff
2 changed files with 6 additions and 6 deletions

View File

@@ -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");
}