Adjust debug log scroll position

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2022-06-24 23:41:56 -03:00
parent 6ad34cbb0e
commit 718ace5d3d

View File

@@ -39,8 +39,9 @@ function eventsource() {
"message",
function (e) {
ta.append(e.data);
// scroll page to the bottom (to the last received data)
$("html, body").scrollTop($(document).height());
// scroll to the bottom of #output (most recent data)
var taBottom = ta.offset().top + ta.outerHeight(true);
$("html, body").scrollTop(taBottom - $(window).height());
},
false
);