22 lines
606 B
JavaScript
22 lines
606 B
JavaScript
function togglePostEdit(id){
|
|
body = document.getElementById("post-body");
|
|
title = document.getElementById("post-title");
|
|
form = document.getElementById("edit-post-body-"+id);
|
|
|
|
body.classList.toggle("d-none");
|
|
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);
|
|
|
|
close_inline_speed_emoji_modal();
|
|
};
|
|
|
|
document.getElementById('post-edit-title').addEventListener('keydown', (e) => {
|
|
if (e.key === "Enter") e.preventDefault();
|
|
})
|