Add delete confirmation
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user