From 8d01f9b0f3bcc89cb2e4d73059a191111ba0b914 Mon Sep 17 00:00:00 2001 From: mrilyew <99399973+mrilyew@users.noreply.github.com> Date: Sun, 25 May 2025 10:56:39 +0300 Subject: [PATCH] feat(comms): warning before deletion --- Web/Presenters/templates/components/comment.xml | 2 +- Web/static/js/al_wall.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Web/Presenters/templates/components/comment.xml b/Web/Presenters/templates/components/comment.xml index c4e0de08..37c9cba2 100644 --- a/Web/Presenters/templates/components/comment.xml +++ b/Web/Presenters/templates/components/comment.xml @@ -44,7 +44,7 @@ {if !$timeOnly} {if $comment->canBeDeletedBy($thisUser)} | - {_delete} + {_delete} {/if} {if $comment->canBeEditedBy($thisUser)} | diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 7d3b7139..9d529b5c 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -606,6 +606,21 @@ function reportClub(club_id) { ]); } +$(document).on("click", "#_ajaxDelete", function(e) { + MessageBox(tr('warning'), tr('question_confirm'), [ + tr('yes'), + tr('no') + ], [ + () => { + window.router.route(e.target.href) + }, + Function.noop + ]); + + e.stopPropagation() + return e.preventDefault(); +}); + $(document).on("click", "#_photoDelete, #_videoDelete, #_anotherDelete", function(e) { var formHtml = "