From 0ffe426ff1bf63cf5220c4d0994071c33b3a95eb Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Thu, 27 Apr 2017 08:39:35 +0200 Subject: [PATCH] Frio: Enable stiky aside only on desktop-size windows. "Hack" to fix the "scroll back to top" problem with chrome-based browsers, sticky-kit and off-canvas aside --- view/theme/frio/css/style.css | 3 --- view/theme/frio/js/theme.js | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 678bb91b16..937e55042a 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -126,9 +126,6 @@ code { aside.canvas-slid::before { opacity: 1; } - aside + div { - display:none!important; - } } /* diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index 7412df9b8e..62c45b3da2 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -317,17 +317,19 @@ $(document).ready(function(){ }); /* - * Sticky aside on page scroll + * Sticky aside on page scroll, only on desktop */ - $("aside").stick_in_parent({ - offset_top: 100, // px, header + tab bar + spacing - recalc_every: 10 - }); - // recalculate sticky aside on clicks. - // this handle height changes on expanding submenus - $("aside").on("click", function(){ - $(document.body).trigger("sticky_kit:recalc"); - }); + if ($(window).width() > 976) { + $("aside").stick_in_parent({ + offset_top: 100, // px, header + tab bar + spacing + recalc_every: 10 + }); + // recalculate sticky aside on clicks. + // this handle height changes on expanding submenus + $("aside").on("click", function(){ + $(document.body).trigger("sticky_kit:recalc"); + }); + } }); function openClose(theID) { -- 2.39.5