Fix to close modal & reply input
This commit is contained in:
parent
c536582889
commit
fa36bb72aa
3 changed files with 14 additions and 13 deletions
10
index.html
10
index.html
|
@ -257,18 +257,16 @@
|
|||
<div id="reply-modal-content" class="modal-content">
|
||||
<header>
|
||||
<label>Reply To</label>
|
||||
<button class="icon" onclick="close_reply()">
|
||||
<button class="icon" onclick="close_modal(this)">
|
||||
<img class="icon svg" src="icon/close-modal.svg"/>
|
||||
</button>
|
||||
</header>
|
||||
<div id="replying-to"></div>
|
||||
<div id="replybox">
|
||||
<textarea id="reply-content" class="post-input" oninput="post_input_changed(this)"
|
||||
placeholder="Write your reply here..."></textarea>
|
||||
<textarea id="reply-content" class="post-input"
|
||||
placeholder="Reply..."></textarea>
|
||||
<div class="post-tools">
|
||||
<button id="reply-button" class="action" onclick="do_send_reply()">
|
||||
Reply
|
||||
</button>
|
||||
<button id="reply-button" class="action">Reply</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -488,6 +488,14 @@ function init_postbox(model) {
|
|||
find_node("button[role='send']").addEventListener("click", onclick_send);
|
||||
find_node("button[role='toggle-cw']")
|
||||
.addEventListener("click", onclick_toggle_cw);
|
||||
// Do reply box
|
||||
// TODO refactor & cleanup reply modal init
|
||||
find_node("#reply-content").addEventListener("input", oninput_post);
|
||||
find_node("#reply-button").addEventListener("click", onclick_reply);
|
||||
}
|
||||
async function onclick_reply(ev) {
|
||||
// Temp method
|
||||
do_send_reply();
|
||||
}
|
||||
async function onclick_send(ev) {
|
||||
const el = view_get_timeline_el();
|
||||
|
|
|
@ -77,11 +77,6 @@ function close_media_preview() {
|
|||
find_node("#media-preview").classList.add("closed");
|
||||
}
|
||||
|
||||
function close_reply() {
|
||||
const modal = document.querySelector("#reply-modal")
|
||||
modal.classList.add("closed");
|
||||
}
|
||||
|
||||
function delete_post_confirm(evid) {
|
||||
if (!confirm("Are you sure you want to delete this post?"))
|
||||
return;
|
||||
|
@ -100,7 +95,7 @@ async function do_send_reply() {
|
|||
const content = reply_content_el.value;
|
||||
await send_reply(content, evid, all);
|
||||
reply_content_el.value = "";
|
||||
close_reply();
|
||||
close_modal(modal);
|
||||
}
|
||||
|
||||
function reply(evid, all=false) {
|
||||
|
@ -204,7 +199,7 @@ function open_faqs() {
|
|||
}
|
||||
|
||||
function close_modal(el) {
|
||||
while (el.parentElement) {
|
||||
while (el) {
|
||||
if (el.classList.contains("modal")) {
|
||||
el.classList.add("closed");
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue