Add explanatory notes to deletion logics.
This commit is contained in:
@@ -44,6 +44,7 @@ function abspath(path, name){
|
||||
|
||||
// ua
|
||||
$(document).ready(function() {
|
||||
// for deleting the current page
|
||||
$('#delete-link').click( function(e) {
|
||||
var ok = confirm($(this).data('confirm'));
|
||||
if ( ok ) {
|
||||
@@ -57,7 +58,7 @@ $(document).ready(function() {
|
||||
// Don't navigate on cancel.
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
// for deleting files and pages from the overview
|
||||
$('.delete-file').click( function(e) {
|
||||
var ok = confirm($(this).data('confirm'));
|
||||
if ( ok ) {
|
||||
@@ -65,7 +66,7 @@ $(document).ready(function() {
|
||||
$.post('<%=delete_path %>' + $(this).data('file-path'),
|
||||
{},
|
||||
function (result) {
|
||||
// page successfully deleted, stay on page but remove element from DOM
|
||||
// file successfully deleted, stay on overview but remove element from DOM
|
||||
element.closest("li").remove();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user