can i add submenu on topbar ?
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Is it into the drop-in panel? Exp; for "Profile", "Settings", "Messages" item etc.
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Babylon Layout doesn't support this feature. Maybe, you can write custom css style and JS codes to support it.
My Test;
My Test;
Code: Select all
//CSS
<style>
.layout-wrapper .layout-topbar .topbar-menu > li > ul li > ul {
list-style-type: none;
padding-left: 0px;
height: 0;
overflow: hidden;
}
.layout-wrapper .layout-topbar .topbar-menu > li > ul li > ul a {
padding-left: 28px;
}
.layout-wrapper .layout-topbar .topbar-menu > li > ul li.active-submenuitem > ul {
height: auto;
}
@media screen and (max-width: 896px) {
.layout-wrapper .layout-topbar .topbar-menu > li > ul li > ul a {
padding-left: 44px;
}
}
</style>
Code: Select all
// in layout.js
// please add the following code to line 243
this.topbarLinks.next('ul').find('> li > a').on('click', function(e) {
var link = $(this),
item = link.parent(),
submenu = item.next();
$this.topbarMenuClick = true;
item.siblings('.active-submenuitem').removeClass('active-submenuitem');
if(submenu.length) {
item.toggleClass('active-submenuitem');
}
if (link.attr('href') === '#') {
e.preventDefault();
}
});
$(document.body).on('click', function () { // line 244
...
Code: Select all
//topbar.xhtml
...
<ul>
<li>
<a href="#">
<i class="fa fa-fw fa-user"></i>
<span>Profile</span>
</a>
<ul> <!-- Please add this tag for submenu -->
<li>
<a href="#">
<i class="fa fa-fw fa-home"></i>
<span>TEST</span>
</a>
</li>
</ul> <!-- End -->
</li>
<li>
<a href="#">
<i class="fa fa-fw fa-cog"></i>
<span>Settings</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-fw fa-envelope-o"></i>
<span>Messages</span>
</a>
</li>
...
[code]
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests