From 6563265e62fed490e6b43877d6d5bdb7c4c4666a Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: May 12 2012 01:29:51 +0000 Subject: document.height is no longer supported in modern browsers --- diff --git a/www/static/js/watchlogs.js b/www/static/js/watchlogs.js index f70c62b..2f0cdcd 100644 --- a/www/static/js/watchlogs.js +++ b/www/static/js/watchlogs.js @@ -32,7 +32,7 @@ function maybeScroll(origHeight) { if ((window.pageYOffset + window.innerHeight) >= origHeight) { // Only scroll the window if we were already at the bottom // of the document - window.scroll(window.pageXOffset, document.height); + window.scroll(window.pageXOffset, document.body.clientHeight); } } @@ -106,7 +106,7 @@ function getStatus() { function checkTasks() { if (tasks.length == 0) { - docHeight = document.height; + docHeight = document.body.clientHeight; logElement.appendChild(document.createTextNode("\n==> Task has completed <==\n")); maybeScroll(docHeight); } else { @@ -162,7 +162,7 @@ function handleLog(event) { content = req.responseText; offsets[currentTaskID][currentLog] += content.length; if (content.length > 0) { - docHeight = document.height; + docHeight = document.body.clientHeight; currlog = currentTaskID + ":" + currentLog; if (currlog != lastlog) { logElement.appendChild(document.createTextNode("\n==> " + currlog + " <==\n"));