mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Modified Taillog to prevent offscreen scrolling.
Signed-off-by: Toakan <tdaykin@live.co.uk>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user