mirror of
https://github.com/openvk/openvk
synced 2025-06-07 20:34:38 +03:00
feat(comms): warning before deletion
This commit is contained in:
parent
e7faa45050
commit
8d01f9b0f3
2 changed files with 16 additions and 1 deletions
|
@ -44,7 +44,7 @@
|
|||
{if !$timeOnly}
|
||||
{if $comment->canBeDeletedBy($thisUser)}
|
||||
|
|
||||
<a href="/comment{$comment->getId()}/delete">{_delete}</a>
|
||||
<a href="/comment{$comment->getId()}/delete" id="_ajaxDelete">{_delete}</a>
|
||||
{/if}
|
||||
{if $comment->canBeEditedBy($thisUser)}
|
||||
|
|
||||
|
|
|
@ -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 = "<form id='tmpPhDelF' action='" + u(this).attr("href") + "' >";
|
||||
formHtml += "<input type='hidden' name='hash' value='" + u("meta[name=csrf]").attr("value") + "' />";
|
||||
|
|
Loading…
Reference in a new issue