show char limit when toggling post and comment edit + other minor improvements

pull/211/head
Aevann 2023-10-02 07:58:25 +03:00
parent ee8a0c5898
commit 3cce4f28fb
2 changed files with 19 additions and 11 deletions

View File

@ -82,16 +82,20 @@ function toggleReplyBox(t, id) {
}
function toggleEdit(id){
comment = document.getElementById("comment-text-"+id);
form = document.getElementById("comment-edit-"+id);
box = document.getElementById('comment-edit-body-'+id);
actions = document.getElementById('comment-' + id +'-actions');
const comment = document.getElementById("comment-text-"+id);
const form = document.getElementById("comment-edit-"+id);
const box = document.getElementById('comment-edit-body-'+id);
const actions = document.getElementById('comment-' + id +'-actions');
comment.classList.toggle("d-none");
form.classList.toggle("d-none");
actions.classList.toggle("d-none");
autoExpand(box);
markdown(box);
if (comment.classList.contains('d-none')) {
autoExpand(box);
markdown(box);
charLimit(box.id, 'charcount-edit-' + id)
}
close_inline_speed_emoji_modal();
};

View File

@ -7,11 +7,15 @@ function togglePostEdit(id) {
title.classList.toggle("d-none");
form.classList.toggle("d-none");
box = document.getElementById("post-edit-box-"+id);
autoExpand(box);
markdown(box);
box = document.getElementById("post-edit-title");
autoExpand(box);
if (body.classList.contains('d-none')) {
let box = document.getElementById("post-edit-box-"+id);
autoExpand(box);
markdown(box);
charLimit(box.id, 'charcount-post-edit')
box = document.getElementById("post-edit-title");
autoExpand(box);
}
close_inline_speed_emoji_modal();
};