diff options
Diffstat (limited to 'app/assets/javascripts/build.js')
-rw-r--r-- | app/assets/javascripts/build.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 74babedae89..1dfa064acfd 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -64,9 +64,10 @@ window.Build = (function () { $(window) .off('scroll') .on('scroll', () => { - if (this.$buildTraceOutput.prop('scrollHeight') > this.windowSize) { + const contentHeight = this.$buildTraceOutput.prop('scrollHeight'); + if (contentHeight > this.windowSize) { // means the user did not scroll, the content was updated. - this.windowSize = this.$buildTraceOutput.prop('scrollHeight'); + this.windowSize = contentHeight; } else { // User scrolled this.hasBeenScrolled = true; @@ -113,7 +114,7 @@ window.Build = (function () { if (this.canScroll()) { if (currentPosition > 0 && - (document.body.scrollHeight - document.body.scrollTop !== windowHeight)) { + (document.body.scrollHeight - currentPosition !== windowHeight)) { // User is in the middle of the log this.toggleDisableButton(this.$scrollTopBtn, false); @@ -123,7 +124,7 @@ window.Build = (function () { this.toggleDisableButton(this.$scrollTopBtn, true); this.toggleDisableButton(this.$scrollBottomBtn, false); - } else if (document.body.scrollHeight - document.body.scrollTop === windowHeight) { + } else if (document.body.scrollHeight - currentPosition === windowHeight) { // User is at the bottom of the build log. this.toggleDisableButton(this.$scrollTopBtn, false); |