From 9d1872567084bb2264299b8e5ae1601cfb43ba50 Mon Sep 17 00:00:00 2001 From: echicken Date: Tue, 29 Jan 2019 14:59:17 -0500 Subject: [PATCH] Home cursor in post body textarea. --- web/root/js/forum.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/root/js/forum.js b/web/root/js/forum.js index 31a5aa2..3e515a9 100644 --- a/web/root/js/forum.js +++ b/web/root/js/forum.js @@ -104,6 +104,7 @@ function addNew(sub) { $('#newmessage-body').val( $('#newmessage-body').val() + '\r\n' + data.signature ); + $("#newmessage-body")[0].setSelectionRange(0,0); }); window.location.hash = '#newmessage'; $('#newmessage-body').keydown(function (evt) { @@ -270,6 +271,8 @@ function addReply(sub, id) { ); $.getJSON('./api/forum.ssjs?call=get-signature', function (data) { $('#replytext-' + id).val($('#replytext-' + id).val() + '\r\n' + data.signature); + $('#replytext-' + id)[0].setSelectionRange(0,0); + }); $('#replytext-' + id).keydown(function (evt) { evt.stopImmediatePropagation();