Modified Taillog to prevent offscreen scrolling.

Signed-off-by: Toakan <tdaykin@live.co.uk>
This commit is contained in:
Toakan
2018-02-15 09:16:48 +00:00
parent e48aa295bd
commit e963fbf4e0
4 changed files with 14 additions and 12 deletions

View File

@@ -14,14 +14,15 @@ function reloadData(){
clearTimeout(timer);
$.getJSON("scripts/pi-hole/php/tailLog.php?offset="+offset, function (data)
{
offset = data["offset"];
pre.append(data["lines"]);
if(scrolling && offset !== data["offset"]) {
pre.scrollTop(pre[0].scrollHeight);
}
offset = data["offset"];
});
if(scrolling)
{
window.scrollTo(0,document.body.scrollHeight);
}
timer = setTimeout(reloadData, interval);
}