Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-01-03 00:06:56 +0300
committerFilipa Lacerda <filipa@gitlab.com>2018-01-03 00:06:56 +0300
commita276391b18e113d443716bd719bb9f70e3fd3d99 (patch)
treeb56f14596611e0be631d432dfada5b8cbc35b6a6
parent6db6856d8dee1810a25f1a4c5a665329c5ad598b (diff)
Cache document query
-rw-r--r--app/assets/javascripts/job.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/job.js b/app/assets/javascripts/job.js
index f94b0fdbb5e..8f32dcc94e2 100644
--- a/app/assets/javascripts/job.js
+++ b/app/assets/javascripts/job.js
@@ -100,8 +100,9 @@ export default class Job {
}
toggleScroll() {
- const currentPosition = $(document).scrollTop();
- const scrollHeight = $(document).height();
+ const $document = $(document);
+ const currentPosition = $document.scrollTop();
+ const scrollHeight = $document.height();
const windowHeight = $(window).height();
if (this.canScroll()) {