Skip to content

Instantly share code, notes, and snippets.

@matthewrobertbell
Created July 19, 2011 21:04
Show Gist options
  • Save matthewrobertbell/1093707 to your computer and use it in GitHub Desktop.
Save matthewrobertbell/1093707 to your computer and use it in GitHub Desktop.
generic delete dialog
$('.delete-item-link').click(function(event) {
event.preventDefault();
var a = this;
$('#delete-dialog-confirm').dialog({resizable: false,
height:220,
modal: true,
buttons: {
"Delete": function() {
$.post(window.location.pathname+a.id+'/delete/', {csrfmiddlewaretoken:csrf}, function(data) {
$('#row-'+a.id).hide();
});
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
, autoOpen: true }
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment