From 394d0fd3c8d07538af9d2065178ee4845b25c7d3 Mon Sep 17 00:00:00 2001 From: Kushal Pandya Date: Mon, 5 Dec 2016 17:23:51 +0530 Subject: ESLint: Clean up nested if blocks --- app/assets/javascripts/build.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'app/assets/javascripts/build.js') diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 99cd5c88479..e9107f1b553 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -192,15 +192,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'); } }; -- cgit v1.2.1