summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/build.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-06-02 16:16:54 +0000
committerPhil Hughes <me@iamphill.com>2017-06-02 16:16:54 +0000
commite7de234d6f27781938858bee0ccd01ab1fbd082f (patch)
treed987b4ea7e5545dd6af9ac56fcfa46f5cfb5964c /app/assets/javascripts/build.js
parentaea03d7cdfb882762426dbb5cab805682afe5e2a (diff)
downloadgitlab-ce-e7de234d6f27781938858bee0ccd01ab1fbd082f.tar.gz
Use throttle when window is resized
Diffstat (limited to 'app/assets/javascripts/build.js')
-rw-r--r--app/assets/javascripts/build.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js
index 1a602cbd8a7..072a899e9f2 100644
--- a/app/assets/javascripts/build.js
+++ b/app/assets/javascripts/build.js
@@ -64,7 +64,7 @@ window.Build = (function () {
$(window)
.off('resize.build')
- .on('resize.build', this.sidebarOnResize.bind(this));
+ .on('resize.build', _.throttle(this.sidebarOnResize.bind(this), 100));
this.updateArtifactRemoveDate();
@@ -250,6 +250,7 @@ window.Build = (function () {
Build.prototype.sidebarOnResize = function () {
this.toggleSidebar(this.shouldHideSidebarForViewport());
+
this.verifyTopPosition();
if (this.$scrollContainer.getNiceScroll(0)) {