Currently, I am in the process of enhancing an active tab on my menu by adding a bulletpoint. The script that accomplishes this is depicted below:
$(document).ready(function() {
//add class active to a tab based on url
switch (window.location.pathname) {
case '/admin/statistics':
$('#statistics').addClass('is-active bulletpoint');
break;
case '/admin/articles':
$('#articles').addClass('is-active bulletpoint');
$('.tabs').append('<li class="tabs-title search"><i class="ion-ios-search"></i><input id="search-table" type="text" class="search-input" placeholder="Søk"></li>');
break;
case '/admin/users':
$('#users').addClass('is-active bulletpoint');
$('.tabs').append('<li class="tabs-title search"><i class="ion-ios-search"></i><input type="text" class="search-input" id="search-table" placeholder="Søk"></li>');
break;
case '/admin/articles/create':
$('#create').addClass('is-active bulletpoint');
break;
case '/admin/notifications/create':
$('#notification').addClass('is-active bulletpoint');
break;
}
});
.tabs {
background-color: #353A41;
border: 0;
height: 56px;
}
.tabs a{
color: #FFFFFF;
font-size: 17px;
}
.tabs a:hover, .is-active {
background-color: #2A2E34;
}
.bulletpoint {
list-style-type: disc;
list-style-position: inside;
color: #FFFFFF;
height: 100%;
line-height: 1;
}
.tabs-title > a {
display: block;
padding: 1.25rem 1.5rem;
line-height: 1;
font-size: 0.75rem;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js*></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrackcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<ul class="tabs">
<li class="tabs-title" id="create"><a href="{{ url('/admin/articles/create') }}">Add New Post</a></li>
<li class="tabs-title" id="articles"><a href="{{ url('/admin/articles') }}">My Posts</a></li>
@if (Auth::user()->hasRole('admin'))
<li class="tabs-title" id="statistics"><a href="{{ url('/admin/statistics') }}">Statistics</a></li>
<li class="tabs-title" id="users"><a href="{{ url('/admin/users') }}">Users</a></li>
<li class="tabs-title" id="notification"><a href="{{ url('/admin/notifications/create') }}">New Message</a></li>
@endif
</ul>
While the bulletpoint has been successfully added, it seems to lack vertical alignment within the tab. The desired alignment needs to be achieved to keep it neatly enclosed. Here's what it currently looks like:
https://i.sstatic.net/grkJG.png
Various methods have been attempted to align the bulletpoint vertically, but unfortunately none have yielded satisfactory results.