From: fabrixxm Date: Mon, 8 May 2017 13:14:31 +0000 (+0200) Subject: frio mobile: disable page scroll when aside is shown X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d162e689daf6b5f401c29f6772a6ee8b65d8f509;p=friendica.git frio mobile: disable page scroll when aside is shown --- diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index 937e55042a..e787384eda 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -127,6 +127,8 @@ code { opacity: 1; } + /* prevent page scroll when the aside is opened **/ + body.aside-out { overflow: hidden; } } /* * standard page elements diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index a335fffbdb..047cce16b0 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -338,6 +338,21 @@ $(document).ready(function(){ $(document.body).trigger("sticky_kit:recalc"); }); } + + /* + * Add or remove "aside-out" class to body tag + * when the mobile aside is shown or hidden. + * The class is used in css to disable scroll in page when the aside + * is shown. + */ + $("aside") + .on("shown.bs.offcanvas", function() { + $("body").addClass("aside-out"); + }) + .on("hidden.bs.offcanvas", function() { + $("body").removeClass("aside-out"); + }); + }); function openClose(theID) {