From d5700f8832f91339d74b6496b35730693876fa55 Mon Sep 17 00:00:00 2001 From: OHTAKE Tomohiro Date: Wed, 12 Oct 2011 11:01:17 +0900 Subject: [PATCH] [FIXED JENKINS-11307] "Tailing" the console of an active job broken in 1.434 --- changelog.html | 3 +++ war/src/main/webapp/scripts/hudson-behavior.js | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 34cd29d1b1..30167ac645 100644 --- a/changelog.html +++ b/changelog.html @@ -61,6 +61,9 @@ Upcoming changes
  • Avoid overwriting the repository definitions. (issue 11229) +
  • + "Tailing" the console of an active job broken in 1.434 + (issue 11307)
  • Improved the classloading performance diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index 27b8f3d737..8a2c7bd5b4 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -1370,7 +1370,8 @@ function AutoScroller(scrollContainer) { // the element height. //var height = ((scrollDiv.style.pixelHeight) ? scrollDiv.style.pixelHeight : scrollDiv.offsetHeight); var height = getViewportHeight(); - var diff = currentHeight - scrollDiv.scrollTop - height; + var scrollPos = Math.max(scrollDiv.scrollTop, document.documentElement.scrollTop); + var diff = currentHeight - scrollPos - height; // window.alert("currentHeight=" + currentHeight + ",scrollTop=" + scrollDiv.scrollTop + ",height=" + height); return diff < this.bottomThreshold; @@ -1378,7 +1379,9 @@ function AutoScroller(scrollContainer) { scrollToBottom : function() { var scrollDiv = $(this.scrollContainer); - scrollDiv.scrollTop = this.getCurrentHeight(); + var currentHeight = this.getCurrentHeight(); + if(document.documentElement) document.documentElement.scrollTop = currentHeight + scrollDiv.scrollTop = currentHeight; } }; } -- GitLab