refstack/refstack-ui/app/shared/header/headerController.js
Paul Van Eck cfe34d9371 Added groundwork for the refstack user-interface.
Used a combination of AngularJS and Bootstrap to form
a preliminary front-end website for Refstack. Most of the content
text can be considered placeholders and is subject to change.

Change-Id: Ide82783478d1863052fe54d02ca6ee88113c46b2
2015-04-13 23:43:43 -07:00

19 lines
624 B
JavaScript

'use strict';
/* Refstack Header Controller */
var refstackApp = angular.module('refstackApp')
refstackApp.controller('headerController', ['$scope', '$location', function($scope, $location) {
$scope.navbarCollapsed = true;
$scope.isActive = function(viewLocation) {
var path = $location.path().substr(0, viewLocation.length);
if (path === viewLocation) {
// Make sure "/" only matches when viewLocation is "/".
if (!($location.path().substr(0).length > 1 && viewLocation.length === 1 )) {
return true;
}
}
return false;
};
}]);