292 mobile left nav (#303)

* added links for expandable headings for each of clicking on ipads (touch events try to jump to the nearest <a> tag, so trying to click the expand section would often trigger clicking the first link under it)

* fixed jumping back and forth of left nav when initial pageload has short width
This commit is contained in:
ryangrahamnc 2017-05-22 16:51:06 -04:00 committed by Shriram Rajagopalan
parent 07eab3de86
commit b8b7cba8bc
3 changed files with 12 additions and 2 deletions

View File

@ -101,4 +101,11 @@
.tree-toggle {
cursor: pointer;
margin-left: -1em;
.tree-toggle-link{
&, &:focus, &:hover{
color:#535f61 !important;
text-decoration: none;
}
}
}

View File

@ -101,11 +101,13 @@ function outputNavBarTree(items) {
document.writeln("<li class='doc-side-nav-list-item'>");
document.writeln("<label class='tree-toggle'>");
document.writeln("<i class='fa fa-lg fa-caret-down'></i>");
document.writeln("<a class='tree-toggle-link' href='javascript:void 0;'>");
if (item.doc == null) {
document.writeln(item.name);
} else {
document.writeln(item.doc.title);
}
document.writeln("</a>");
document.writeln("</label>");
if (item.doc.order == 9999) {

View File

@ -12,9 +12,10 @@
// sidebar.height($('footer').position().top + 50);
// 992 is the default breakpoint set in Bootstrap 3 for col-md
var width = $(document).width();
if (width < 992) {
sidebar.toggle();
sidebarOpen = !sidebarOpen;
sidebar.hide();
sidebarOpen = false;
}
}