
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
19 lines
624 B
JavaScript
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;
|
|
};
|
|
}]);
|