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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-12-08 12:11:54 +0300
committerPhil Hughes <me@iamphill.com>2017-12-08 12:11:54 +0300
commit1d4a2d2ad167e4b50ddfc94114e98fa4da4a6c5a (patch)
treea8f463a48081b2eb1cb8e71bc8d2869369af6a9d /content
parent1444e0557e028b16303bd7fc2dfb24837a50d8b6 (diff)
Fixed sidebar becoming fixed on smaller screens
Closes #148
Diffstat (limited to 'content')
-rw-r--r--content/assets/javascripts/docs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/content/assets/javascripts/docs.js b/content/assets/javascripts/docs.js
index e9070f2b..ae70aad0 100644
--- a/content/assets/javascripts/docs.js
+++ b/content/assets/javascripts/docs.js
@@ -44,6 +44,8 @@ function toggleNavigation() {
var sidebarHeight = sidebar.querySelector('ul').getBoundingClientRect().height + 55;
document.addEventListener('scroll', function() {
+ if (window.innerWidth < 1099) return;
+
if (window.scrollY + sidebarHeight >= main[0].offsetHeight) {
sidebar.style.position = 'absolute';
sidebar.style.top = (main[0].offsetHeight - sidebarHeight) + 'px';
@@ -51,7 +53,7 @@ function toggleNavigation() {
sidebar.style.position = '';
sidebar.style.top = '';
}
- });
+ }, { passive : true });
}
// remove what is left of the old navigation