When replying to a comment now it autofocus the input

master
Yo Mama 2021-09-16 00:09:38 +02:00
parent f2081b7594
commit b934f52d19
2 changed files with 10 additions and 1 deletions

View File

@ -275,7 +275,7 @@
aria-hidden="true"></i><span class="d-none d-md-inline-block">Give Award</span></a></li>
{% endif %}
<li class="list-inline-item text-muted"><a href="javascript:void(0)" onclick="document.getElementById('reply-to-{{c.id}}').classList.remove('d-none')"><i class="fas fa-reply" aria-hidden="true"></i><span class="d-none d-md-inline-block">Reply</span></a></li>
<li class="list-inline-item text-muted"><a href="javascript:void(0)" onclick="openReplyBox('{{c.id}}')"><i class="fas fa-reply" aria-hidden="true"></i><span class="d-none d-md-inline-block">Reply</span></a></li>
{% endif %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a {% if v %}href="{{c.permalink}}?context=5#context"{% else %}href="/logged_out{{c.permalink}}?context=5#context"{% endif %}><i class="fas fa-book-open"></i>Context</a></li>

View File

@ -105,6 +105,15 @@
});
// Open comment reply box
function openReplyBox(id) {
const element = document.getElementById(`reply-to-${id}`);
element.classList.remove('d-none')
element.getElementsByTagName('textarea')[0].focus()
}
// Comment edit form
toggleEdit=function(id){