summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2016-12-05 17:23:51 +0530
committerKushal Pandya <kushal@gitlab.com>2016-12-21 13:16:17 +0530
commitdaa08cbe04028e8303321e16dd96c71bb7a6c703 (patch)
tree560cf99ebc17160771d24ac29e4ac3aad2dc3593
parent3d134c50b3baf83b5f675d5e6bda2171924d2ab8 (diff)
downloadgitlab-ce-daa08cbe04028e8303321e16dd96c71bb7a6c703.tar.gz
ESLint: Clean up nested if blocks
-rw-r--r--app/assets/javascripts/build.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 874cf0d3023..e0ae5e5ed6a 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
};