Implementing basic open/collapse functionality resolves #13.
This commit is contained in:
6
app.css
6
app.css
@@ -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;
|
||||
}
|
||||
|
||||
2
app.html
2
app.html
@@ -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
5
app.js
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user