offset_top: 100, // px, header + tab bar + spacing
recalc_every: 10
});
- // recalculate sticky aside on clicks.
+ // recalculate sticky aside on clicks on <a> elements
// this handle height changes on expanding submenus
- $("aside").on("click", function(){
+ $("aside").on("click", "a", 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) {