edit comment

This commit is contained in:
themohooks 2024-10-03 21:53:35 +03:00
parent 24b3ef9726
commit d63f0f4df1
2 changed files with 11 additions and 3 deletions

View file

@ -76,7 +76,7 @@ class Comment {
<div class="dropdown">
<a style="color: #000" class="compl" href="/lk/ticket.php?action=add&amp;wid=3252565">...</a>
<div class="dropdown-content">'; ?>
<a href="#" onclick="createModal(100, 'EDIT_COMMENT'); return false;">Редактировать</a><br>
<a href="#" onclick="createModal(100, 'EDIT_COMMENT', '<?=htmlspecialchars($this->c['body'])?>'); return false;">Редактировать</a><br>
<a href="#" onclick="createModal(100, 'DELETE_COMMENT'); return false;">Удалить</a>
<?php
echo '

View file

@ -1,12 +1,20 @@
function createModal(id, type) {
function createModal(id, type, value) {
if (type === 'EDIT_COMMENT') {
var modal = `
<div id="modal`+id+`" class="modal" style="display: block;">
<div class="modal-content">
<span data-modal-id="`+id+`" class="close">&times;</span>
<p>Some text in the Modal..</p>
<h3><b>Отредактировать комментарий</b></h3>
<div style="padding:0 11px 11px">
<textarea name="wtext" id="wtext">`+value+`</textarea><br>
<p id="statusSend" style="display: none;">Ошибка</p>
<div class="cmt-submit"><input type="submit" value="Отредактировать" id="sbmt">&ensp;&emsp;Ctrl + Enter
</div>
</div>
</div>
</div>`;