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