diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 874cf0d3023f46bf8b4ddc117102a006c49e9792..e0ae5e5ed6ae02552aa4d2819d07f1813fec73ae 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -210,15 +210,8 @@ } if (this.buildStatus === "running" || this.buildStatus === "pending") { - if (isInViewport($('.js-build-refresh'))) { // Check if Refresh Animation is in Viewport - if ($autoScrollStatus.data("state") === 'disabled') { - $autoScrollStatus.data("state", 'enabled'); // Enable Autoscroll - } - } else { - if ($autoScrollStatus.data("state") === 'enabled') { - $autoScrollStatus.data("state", 'disabled'); // Disable Autoscroll - } - } + // Check if Refresh Animation is in Viewport and enable Autoscroll, disable otherwise. + $autoScrollStatus.data("state", isInViewport($('.js-build-refresh')) ? 'enabled' : 'disabled'); } >>>>>>> Improve isInViewport impl, autoscroll behavior };