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
+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);
}
+1 -1
View File
@@ -13,7 +13,7 @@
</div>
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk1"> Automatic scrolling on update</label></div>
<pre id="output" style="width: 100%; height: 100%;"></pre>
<pre id="output" style="width: 100%; height: 100%; max-height:650px; overflow-y:scroll;"></pre>
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk2"> Automatic scrolling on update</label></div>
<?php
+1 -1
View File
@@ -13,7 +13,7 @@
</div>
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk1"> Automatic scrolling on update</label></div>
<pre id="output" style="width: 100%; height: 100%;"></pre>
<pre id="output" style="width: 100%; height: 100%; max-height:650px; overflow-y:scroll;"></pre>
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk2"> Automatic scrolling on update</label></div>
<?php