Dismiss docs sidebar when scrolling left on mobile

This commit is contained in:
Max Brunsfeld 2018-06-12 19:59:30 -07:00
parent 9eab5a29d9
commit 0aef70028a

View file

@ -120,6 +120,13 @@
});
}
$(document).scroll(function() {
if ($(document).scrollLeft() > 0) {
localStorage.setItem('sidebar-active', 'false');
$(document.body).addClass('sidebar-hidden');
}
});
$('h1, h2, h3, h4, h5, h6').filter('[id]').each(function() {
$(this).html('<a href="#'+$(this).attr('id')+'">' + $(this).text() + '</a>');
});