Confirm image delete with jQuery UI modal dialog.

Added config option for jQuery delete as well.
This commit is contained in:
green-ponies (jgen)
2011-08-16 23:14:30 -04:00
parent 80ff538b73
commit eb5ff191c6
4 changed files with 49 additions and 6 deletions

View File

@ -1,3 +1,33 @@
// Adding jQuery ui stuff
$(document).ready(function() {
var $confirm = $('<div id="dialog-confirm"></div>')
.html('<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This image will be permanently deleted and cannot be recovered. Are you sure?</p>')
.dialog({
resizable: false,
height:220,
modal: true,
autoOpen: false,
title: 'Delete Image?',
buttons: {
"Delete Image": function() {
$( this ).dialog( "close" );
$('form#delete_image').submit();
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
$('form#delete_image #delete_image_submit').click(function(e){
e.preventDefault();
$confirm.dialog('open');
});
});
var defaultTexts = new Array();
window.onload = function(e) {