scroll chat when textarea is clicked

master
Aevann1 2022-08-26 19:57:31 +02:00
parent 25a62abc13
commit 43ac6e96fb
2 changed files with 7 additions and 3 deletions

View File

@ -176,4 +176,8 @@ socket.on('typing', function (users){
} }
}) })
box.scrollTo(0, box.scrollHeight) function scroll_chat() {
box.scrollTo(0, box.scrollHeight)
}
scroll_chat()

View File

@ -190,7 +190,7 @@
<span id="loading-indicator" class="d-none"></span> <span id="loading-indicator" class="d-none"></span>
</div> </div>
<i class="btn btn-secondary mr-2 fas fa-smile-beam" style="padding-top:0.65rem" onclick="loadEmojis('input-text')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-placement="bottom" title="Add Emoji"></i> <i class="btn btn-secondary mr-2 fas fa-smile-beam" style="padding-top:0.65rem" onclick="loadEmojis('input-text')" aria-hidden="true" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-placement="bottom" title="Add Emoji"></i>
<textarea id="input-text" minlength="1" maxlength="{% if SITE == 'rdrama.net' %}200{% else %}1000{% endif %}" type="text" class="form-control" placeholder="Message" autocomplete="off" autofocus rows="1"></textarea> <textarea onclick="scroll_chat()" id="input-text" minlength="1" maxlength="{% if SITE == 'rdrama.net' %}200{% else %}1000{% endif %}" type="text" class="form-control" placeholder="Message" autocomplete="off" autofocus rows="1"></textarea>
<button id="chatsend" onclick="send()" class="btn btn-primary ml-3" type="submit" onclick="disable(this)">Send</button> <button id="chatsend" onclick="send()" class="btn btn-primary ml-3" type="submit" onclick="disable(this)">Send</button>
</div> </div>
</div> </div>
@ -214,6 +214,6 @@
<script src="{{asset('js/lozad.js')}}"></script> <script src="{{asset('js/lozad.js')}}"></script>
<script src="/assets/js/lite-youtube.js?v=241"></script> <script src="/assets/js/lite-youtube.js?v=241"></script>
<script src="/chat.js?v=3026"></script> <script src="/chat.js?v=3027"></script>
</body> </body>