Už nemáme text v opravě, takže nemá smysl ho editovat

This commit is contained in:
Jonas Havelka 2025-01-21 08:12:42 +01:00
parent d818ce251b
commit 370dd7d841
2 changed files with 4 additions and 13 deletions

View file

@ -98,23 +98,14 @@ function toggle_visibility(oprava){
}
}
// show comment form, when 'edit' or 'comment' button pressed
function box_edit(op, action)
// show comment form, when 'comment' button pressed
function comment(op)
{
var divpointer = document.getElementById(op.id + '-pointer');
var text;
if (action == 'update') {
var text_el = document.getElementById(op.id + '-text');
text = text_el.textContent;
} else {
text = '';
}
var dx = parseInt(divpointer.style.left);
var dy = parseInt(divpointer.style.top);
return show_form(op.img_id, dx, dy, op.dataset.opid, text, action);
return show_form(op.img_id, dx, dy, op.dataset.opid, "", "comment");
}
// show comment form when 'update-comment' button pressed

View file

@ -49,7 +49,7 @@
<button type='button' value="notcomment" title='Korekturu nelze komentovat, protože už je uzavřená'>
<img src="{% static "korektury/imgs/comment-gr.png" %}"/>
</button>
<button type='button' value="comment" onclick='box_edit(this.parentElement.parentElement.parentElement.parentElement, "comment");' title='Komentovat'>
<button type='button' value="comment" onclick='comment(this.parentElement.parentElement.parentElement.parentElement);' title='Komentovat'>
<img src="{% static "korektury/imgs/comment.png" %}"/>
</button>