Implementing basic open/collapse functionality resolves #13.

This commit is contained in:
Arpad Csanyi
2016-02-27 22:11:51 +01:00
parent b590b8030b
commit 91478c2b3c
3 changed files with 10 additions and 3 deletions

View File

@@ -160,7 +160,8 @@ li {
height: auto;
}
.sidebar__level-1 .fa.fa-chevron-down {
.sidebar__level-1 .fa.fa-chevron-down,
.sidebar__level-1 .fa.fa-chevron-up {
margin-right: 1rem;
font-size: 1.5rem;
position: relative;
@@ -168,6 +169,7 @@ li {
display: none;
}
.sidebar__level-1:hover .fa.fa-chevron-down {
.sidebar__level-1:hover .fa.fa-chevron-down,
.sidebar__level-1:hover .fa.fa-chevron-up {
display: inline-block;
}

View File

@@ -81,7 +81,7 @@
<i class="fa fa-plus"></i>
</a>
{{/if}}
<i class="fa fa-chevron-down pull-right" style=""></i>
<i class="fa fa-chevron-up pull-right" style=""></i>
</div>
{{#if children}}
<ul>

5
app.js
View File

@@ -21,6 +21,11 @@ $(function() {
items: 1
});
$('.sidebar__level-1', '.sidebar__level-1--item').on('click', function() {
$(this).parents('.sidebar__level-1--item').find('ul').slideToggle();
$(this).find('.fa-chevron-down, .fa-chevron-up').toggleClass('fa-chevron-down fa-chevron-up')
});
});
var menuObject = {