help: Close other article headings on click.

This commit adds a minor improvment in clicking
the left sidebar behaviour. So if you click on
an article heading then other opened headings will
be closed automatically. This makes the toggle
experience better.
This commit is contained in:
Akash Nimare
2018-06-07 22:16:17 +05:30
committed by Tim Abbott
parent 733b1a14bb
commit 4b3309f3f0

View File

@@ -137,6 +137,9 @@ function scrollToHash(container) {
var $next = $(e.target).next();
if ($next.is("ul")) {
// Close other article's headings first
$('.sidebar ul').not($next).hide();
// Toggle the heading
$next.slideToggle("fast", "swing", function () {
markdownPS.update();
});