/help/: Fix sidebar target bug.

This tries to toggle the next item when clicking on an <h2>
in the sidebar, however we want to first check the next item is
an <ul> element, so that we are collapsing or showing a list,
instead of something like an <h2> which currently happens with
the "#guides" element.
This commit is contained in:
Brock Whittaker 2017-10-03 16:38:47 -07:00
parent 9c08f9417c
commit a7f602fed6
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,11 @@
};
$(".sidebar h2").click(function (e) {
$(e.target).next().slideToggle('fast');
var $next = $(e.target).next();
if ($next.is("ul")) {
$next.slideToggle("fast");
}
});
$(".sidebar a").click(function (e) {