forked from rDrama/rDrama
show char limit when toggling post and comment edit + other minor improvements
parent
ee8a0c5898
commit
3cce4f28fb
|
@ -82,16 +82,20 @@ function toggleReplyBox(t, id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEdit(id){
|
function toggleEdit(id){
|
||||||
comment = document.getElementById("comment-text-"+id);
|
const comment = document.getElementById("comment-text-"+id);
|
||||||
form = document.getElementById("comment-edit-"+id);
|
const form = document.getElementById("comment-edit-"+id);
|
||||||
box = document.getElementById('comment-edit-body-'+id);
|
const box = document.getElementById('comment-edit-body-'+id);
|
||||||
actions = document.getElementById('comment-' + id +'-actions');
|
const actions = document.getElementById('comment-' + id +'-actions');
|
||||||
|
|
||||||
comment.classList.toggle("d-none");
|
comment.classList.toggle("d-none");
|
||||||
form.classList.toggle("d-none");
|
form.classList.toggle("d-none");
|
||||||
actions.classList.toggle("d-none");
|
actions.classList.toggle("d-none");
|
||||||
|
|
||||||
|
if (comment.classList.contains('d-none')) {
|
||||||
autoExpand(box);
|
autoExpand(box);
|
||||||
markdown(box);
|
markdown(box);
|
||||||
|
charLimit(box.id, 'charcount-edit-' + id)
|
||||||
|
}
|
||||||
|
|
||||||
close_inline_speed_emoji_modal();
|
close_inline_speed_emoji_modal();
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,11 +7,15 @@ function togglePostEdit(id) {
|
||||||
title.classList.toggle("d-none");
|
title.classList.toggle("d-none");
|
||||||
form.classList.toggle("d-none");
|
form.classList.toggle("d-none");
|
||||||
|
|
||||||
box = document.getElementById("post-edit-box-"+id);
|
if (body.classList.contains('d-none')) {
|
||||||
|
let box = document.getElementById("post-edit-box-"+id);
|
||||||
autoExpand(box);
|
autoExpand(box);
|
||||||
markdown(box);
|
markdown(box);
|
||||||
|
charLimit(box.id, 'charcount-post-edit')
|
||||||
|
|
||||||
box = document.getElementById("post-edit-title");
|
box = document.getElementById("post-edit-title");
|
||||||
autoExpand(box);
|
autoExpand(box);
|
||||||
|
}
|
||||||
|
|
||||||
close_inline_speed_emoji_modal();
|
close_inline_speed_emoji_modal();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue