Skip to content

Commit

Permalink
[fixes #388] Adds active class to top nav
Browse files Browse the repository at this point in the history
  • Loading branch information
vrocha committed May 31, 2017
1 parent 3dc76d6 commit 230fcc1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion frontend/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,10 @@ angular.module('SchoolsApp.directives', [])
.directive('simpleNav', [function() {
return {
restrict: 'AE',
templateUrl: 'app/templates/simpleNav.html'
templateUrl: 'app/templates/simpleNav.html',
scope: {
'activeTab': '@'
}
}
}])
.directive('search', [function() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/templates/about.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<simple-nav></simple-nav>
<simple-nav active-tab="about"></simple-nav>

<div class="container">
<h1>About Us</h1>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/templates/map.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<simple-nav class="content-row" id="simple-nav"></simple-nav>
<simple-nav class="content-row" id="simple-nav" active-tab="map"></simple-nav>

<leaflet class="content-row" id="leaflet-map" legend="legend" defaults="defaults" center="durham" maxbounds="durham.maxbounds" event-broadcast="events" geojson="geojson" markers="markers" tiles="tiles"></leaflet>

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/templates/navigating.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<simple-nav></simple-nav>
<simple-nav active-tab="guide"></simple-nav>

<div class="container">
<h1><center>My Public School Choices</center></h1>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/templates/schools.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<simple-nav></simple-nav>
<simple-nav active-tab="schools"></simple-nav>

<div class="container">
<div class="row">
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/templates/simpleNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ <h1 class='name'>Durham School Navigator <small><span class="label label-info">A
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="#/">Map</a></li>
<li><a href="#about">About</a></li>
<li><a href="#navigating">School Guide</a></li>
<li><a href="#schools">Schools</a></li>
<li ng-class="{active: activeTab == 'map'}"><a href="#/">Map</a></li>
<li ng-class="{active: activeTab == 'about'}"><a href="#about">About</a></li>
<li ng-class="{active: activeTab == 'guide'}"><a href="#navigating">School Guide</a></li>
<li ng-class="{active: activeTab == 'schools'}"><a href="#schools">Schools</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
Expand Down

0 comments on commit 230fcc1

Please sign in to comment.