From b934f52d19a2d6ee5b424fbdc98102da17033096 Mon Sep 17 00:00:00 2001 From: Yo Mama Date: Thu, 16 Sep 2021 00:09:38 +0200 Subject: [PATCH] When replying to a comment now it autofocus the input --- files/templates/comments.html | 2 +- files/templates/default.html | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 9f71789e0d..10a1602079 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -275,7 +275,7 @@ aria-hidden="true">Give Award {% endif %} -
  • Reply
  • +
  • Reply
  • {% endif %}
  • Context
  • diff --git a/files/templates/default.html b/files/templates/default.html index 882b8d3c05..8647c9751d 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -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){