diff options
author | Kushal Pandya <kushal@gitlab.com> | 2016-12-13 21:13:27 +0530 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2016-12-21 13:16:18 +0530 |
commit | cc62a416560267d4a87b823faa333bcdaa5867b4 (patch) | |
tree | 074d3301a3a026516fafff13f9c2f96f74c2f965 /app/assets/javascripts/build.js | |
parent | dfd156972df7d47465e9222e1979fa9c91b702aa (diff) | |
download | gitlab-ce-cc62a416560267d4a87b823faa333bcdaa5867b4.tar.gz |
Fix case where Autoscroll indicator overlays scroll bottom button
Diffstat (limited to 'app/assets/javascripts/build.js')
-rw-r--r-- | app/assets/javascripts/build.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 36612957b39..81149a427dc 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -160,11 +160,23 @@ Build.prototype.initScrollMonitor = function() { if (!gl.utils.isInViewport(this.$upBuildTrace[0]) && !gl.utils.isInViewport(this.$downBuildTrace[0])) { // User is somewhere in middle of Build Log this.$scrollTopBtn.show(); - this.$scrollBottomBtn.show(); + + if (this.buildStatus === 'success' || this.buildStatus === 'failed') { // Check if Build is completed + this.$scrollBottomBtn.show(); + } else if (this.$buildRefreshAnimation.is(':visible') && !gl.utils.isInViewport(this.$buildRefreshAnimation[0])) { + this.$scrollBottomBtn.show(); + } else { + this.$scrollBottomBtn.hide(); + } // Hide Autoscroll Status Indicator - this.$autoScrollContainer.hide(); - this.$autoScrollStatusText.removeClass('animate'); + if (this.$scrollBottomBtn.is(':visible')) { + this.$autoScrollContainer.hide(); + this.$autoScrollStatusText.removeClass('animate'); + } else { + this.$autoScrollContainer.css({ top: this.$body.outerHeight() - 75 }).fadeIn(100); + this.$autoScrollStatusText.addClass('animate'); + } } else if (gl.utils.isInViewport(this.$upBuildTrace[0]) && !gl.utils.isInViewport(this.$downBuildTrace[0])) { // User is at Top of Build Log this.$scrollTopBtn.hide(); this.$scrollBottomBtn.show(); |