Vincent Fournier 0931458d80 Add theme size options
Change-Id: I30afc1473bf0f4ab1065816f00f1d73afa9cfbf9
2015-08-09 15:27:11 -04:00

34 lines
1.3 KiB
JavaScript

'use strict';
angular.module('bansho.topbar', ['bansho.surveil'])
.directive('banshoTopbar', function () {
return {
restrict: 'E',
templateUrl: 'components/topbar/topbar.html',
controller: ['$compile', '$element', '$scope', 'authService', 'themeManager', 'viewsTemplate', 'sharedData', 'configManager',
function ($compile, $element, $scope, authService, themeManager, viewsTemplate, sharedData, configManager) {
$scope.logout = function () {
authService.logout();
};
$scope.switchTheme = function () {
themeManager.switchTheme();
};
$scope.setSize = function (size) {
themeManager.setSize(size);
};
authService.registerOnLogin(function () {
$scope.allProblems = sharedData.getData('nbServicesHostsOpenProblems', function (data) {
$scope.allProblems = data;
});
$scope.components = configManager.getConfigData('topbar').components;
$compile($element.contents())($scope);
});
}]
};
});