GUAC-919: Add page-specific CSS class support. Use client-specific body style.

This commit is contained in:
Michael Jumper
2014-11-04 21:24:16 -08:00
parent 0542146e8e
commit 04ce36f335
4 changed files with 15 additions and 4 deletions

View File

@@ -51,7 +51,10 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
};
// Put some useful variables in the top level scope
$scope.page = { title: '' };
$scope.page = {
title: '',
bodyClassName: ''
};
$scope.currentUserID = null;
$scope.currentUserIsAdmin = false;
$scope.currentUserHasUpdate = false;
@@ -106,11 +109,15 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
keyboard.reset();
};
// Update title upon navigation
// Update title and CSS class upon navigation
$scope.$on('$routeChangeSuccess', function(event, current, previous) {
var title = current.$$route.title;
if (title)
$scope.page.title = title;
$scope.page.bodyClassName = current.$$route.bodyClassName || '';
});
}]);