diff --git a/layouts/partials/docs-side-nav.html b/layouts/partials/docs-side-nav.html
index 978c4438329..fd157ef7376 100644
--- a/layouts/partials/docs-side-nav.html
+++ b/layouts/partials/docs-side-nav.html
@@ -1,70 +1,24 @@
-
{{ .Title }}
-
-
-
-
- {{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }}
- }}
-
-
-
- {{ define "section-tree-nav" }}
+
+
+ {{ template "section-tree-nav" ($.Scratch.Get "secondLevel") }}
+
+
+{{ define "section-tree-nav" }}
{{ range .Sections}}
-
- {{ .Title }}keyboard_arrow_down
-
- {{ range .Pages }}
- - {{ .Title }}
- {{ end }}
-
- {{ template "section-tree-nav" . }}
+ - {{ .Title }}
+ {{if gt (len .Sections) 0}}
+ expand_more
+
+ {{ range .Pages }}
+ - {{ .Title }}
+ {{ end }}
+
+ {{ template "section-tree-nav" . }}
+
-
+ {{end}}
-
{{ end }}
{{ end }}
-
-
-
-
diff --git a/src/js/app.js b/src/js/app.js
index 352f39b3d83..87b3c3fba51 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -177,12 +177,32 @@ const bootstrapSorts = function() {
}
const bootstrapNav = function () {
- // debugger;
+ // mobile nav
// init-attaches to js object
mlStackNav();
// consume
$(".js-ml-stack-nav").mlStackNav();
+
+ // sidenav
+ $('.tree-nav .tree-nav-item').on('click', function(e) {
+ // actual clicked element
+ let target = e.target;
+
+ if (!target.href) {
+ // stop it from affecting other nodes
+ e.preventDefault();
+ e.stopPropagation();
+
+ // parent li rather then actual el clicked
+ $(e.currentTarget).toggleClass('open');
+
+ $(e.target).find('>ul.tree-nav-sublist').toggleClass('hide');
+ }
+
+ });
}
+
+
bootstrapNav();
bootstrapDropdowns();
bootstrapModals();
diff --git a/src/sass/app.scss b/src/sass/app.scss
index 3e0f24e0e99..ed371b2deff 100644
--- a/src/sass/app.scss
+++ b/src/sass/app.scss
@@ -58,3 +58,22 @@
visibility: hidden;
display: none;
}
+
+.tree-nav {
+ .tree-nav-item {
+ .tree-nav-sublist {
+ &.hide {
+ display: none;
+ }
+ }
+ &.open {
+ >.expand-more {
+ -webkit-transform: rotate(180deg);
+ -moz-transform: rotate(180deg);
+ -ms-transform: rotate(180deg);
+ -o-transform: rotate(180deg);
+ transform: rotate(180deg);
+ }
+ }
+ }
+}