Skip to content

Commit

Permalink
Fixes StartBootstrap#18 and removes all nav classes with active since…
Browse files Browse the repository at this point in the history
… the javascript will automatically add them based on the url.
  • Loading branch information
challgren committed Dec 25, 2014
1 parent 7cb35d9 commit 6aa0323
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="panels-wells.html">Panels and Wells</a>
</li>
<li>
<a class="active" href="buttons.html">Buttons</a>
<a href="buttons.html">Buttons</a>
</li>
<li>
<a href="notifications.html">Notifications</a>
Expand Down
4 changes: 2 additions & 2 deletions flot.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@
<li>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a class="active" href="flot.html">Flot Charts</a>
<a href="flot.html">Flot Charts</a>
</li>
<li>
<a href="morris.html">Morris.js Charts</a>
Expand Down
2 changes: 1 addition & 1 deletion forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
</li>
<li>
<a class="active" href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
Expand Down
4 changes: 2 additions & 2 deletions grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
Expand All @@ -313,7 +313,7 @@
<a href="icons.html"> Icons</a>
</li>
<li>
<a class="active" href="grid.html">Grid</a>
<a href="grid.html">Grid</a>
</li>
</ul>
<!-- /.nav-second-level -->
Expand Down
4 changes: 2 additions & 2 deletions icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
Expand All @@ -310,7 +310,7 @@
<a href="typography.html">Typography</a>
</li>
<li>
<a class="active" href="icons.html"> Icons</a>
<a href="icons.html"> Icons</a>
</li>
<li>
<a href="grid.html">Grid</a>
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
<!-- /input-group -->
</li>
<li>
<a class="active" href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
Expand Down Expand Up @@ -838,7 +838,7 @@ <h4 class="timeline-title">Lorem ipsum dolor</h4>
</span>
<div class="chat-body clearfix">
<div class="header">
<strong class="primary-font">Jack Sparrow</strong>
<strong class="primary-font">Jack Sparrow</strong>
<small class="pull-right text-muted">
<i class="fa fa-clock-o fa-fw"></i> 12 mins ago
</small>
Expand Down Expand Up @@ -869,7 +869,7 @@ <h4 class="timeline-title">Lorem ipsum dolor</h4>
</span>
<div class="chat-body clearfix">
<div class="header">
<strong class="primary-font">Jack Sparrow</strong>
<strong class="primary-font">Jack Sparrow</strong>
<small class="pull-right text-muted">
<i class="fa fa-clock-o fa-fw"></i> 14 mins ago</small>
</div>
Expand Down
8 changes: 8 additions & 0 deletions js/sb-admin-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ $(function() {
$("#page-wrapper").css("min-height", (height) + "px");
}
});

var url = window.location;
var element = $('ul.nav a').filter(function() {
return this.href == url;
}).addClass('active').parent().parent().addClass('in').parent();
if (element.is('li')) {
element.addClass('active');
}
});
4 changes: 2 additions & 2 deletions morris.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@
<li>
<a href="index.html"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> Charts<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="flot.html">Flot Charts</a>
</li>
<li>
<a class="active" href="morris.html">Morris.js Charts</a>
<a href="morris.html">Morris.js Charts</a>
</li>
</ul>
<!-- /.nav-second-level -->
Expand Down
4 changes: 2 additions & 2 deletions notifications.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
Expand All @@ -304,7 +304,7 @@
<a href="buttons.html">Buttons</a>
</li>
<li>
<a class="active" href="notifications.html">Notifications</a>
<a href="notifications.html">Notifications</a>
</li>
<li>
<a href="typography.html">Typography</a>
Expand Down
4 changes: 2 additions & 2 deletions panels-wells.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a class="active" href="panels-wells.html">Panels and Wells</a>
<a href="panels-wells.html">Panels and Wells</a>
</li>
<li>
<a href="buttons.html">Buttons</a>
Expand Down
2 changes: 1 addition & 1 deletion tables.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<!-- /.nav-second-level -->
</li>
<li>
<a class="active" href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
<a href="tables.html"><i class="fa fa-table fa-fw"></i> Tables</a>
</li>
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
Expand Down
4 changes: 2 additions & 2 deletions typography.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
<li>
<a href="forms.html"><i class="fa fa-edit fa-fw"></i> Forms</a>
</li>
<li class="active">
<li>
<a href="#"><i class="fa fa-wrench fa-fw"></i> UI Elements<span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
Expand All @@ -307,7 +307,7 @@
<a href="notifications.html">Notifications</a>
</li>
<li>
<a class="active" href="typography.html">Typography</a>
<a href="typography.html">Typography</a>
</li>
<li>
<a href="icons.html"> Icons</a>
Expand Down

0 comments on commit 6aa0323

Please sign in to comment.