Add delete confirmation

This commit is contained in:
Eike Foken
2011-08-10 21:02:08 +02:00
parent 9e0c172350
commit 2ea23a7865
3 changed files with 23 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/**
*
* Gets the queued notifications.
*/
function getNotifications() {
$.get(SITE_URL + 'ajax/get_notifications', function(data) {
@@ -9,6 +9,19 @@ function getNotifications() {
});
}
/**
* Asks the user if he is sure to delete an item.
*
* @param url
*/
function deleteConfirm(url) {
var answer = confirm('Are you sure?');
if (answer) {
window.location = url;
}
}
/**
* Saves the changes done by in-place edit.
*