Merge pull request #687 from Toakan/LogScroll

Log scroll
This commit is contained in:
Mark Drobnak
2018-05-29 18:18:31 -04:00
committed by GitHub
4 changed files with 14 additions and 12 deletions
+6 -5
View File
@@ -14,14 +14,15 @@ function reloadData(){
clearTimeout(timer);
$.getJSON("scripts/pi-hole/php/tailLog.php?FTL&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);
}
+6 -5
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);
}