Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add fixed menu to storefront styleguide

Krzysztof Białogłowicz457def0f75e9
diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.js
index 3b675fe43b..dad9a9e61f 100644
--- a/saleor/static/js/storefront.js
+++ b/saleor/static/js/storefront.js
@@ -349,6 +349,19 @@ $cartLine.each(function() {
});
});
+// StyleGuide fixed menu
+
+$(document).ready(function() {
+ let styleGuideMenu = $('.styleguide__nav');
+ $(window).scroll(function () {
+ if ($(this).scrollTop() > 100) {
+ styleGuideMenu.addClass("fixed");
+ } else {
+ styleGuideMenu.removeClass("fixed");
+ }
+ })
+});
+
if ($.cookie('alert') === 'true') {
$removeProductSucces.removeClass('hidden-xs-up');
$.cookie('alert', 'false', { path: '/cart' });
diff --git a/saleor/static/scss/storefront/layouts/_styleguide.scss b/saleor/static/scss/storefront/layouts/_styleguide.scss
index c8456db605..4d1f5e1f1c 100644
--- a/saleor/static/scss/storefront/layouts/_styleguide.scss
+++ b/saleor/static/scss/storefront/layouts/_styleguide.scss
@@ -4,6 +4,10 @@
display: block;
}
margin-bottom: $global-margin * 2;
+ &.fixed {
+ position: fixed;
+ top: 20px;;
+ }
}
&__content {
&__note {