mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-919: Add page-specific CSS class support. Use client-specific body style.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
body {
|
||||
body.client {
|
||||
background: black;
|
||||
font-family: FreeSans, Helvetica, Arial, sans-serif;
|
||||
padding: 0;
|
||||
|
@@ -32,20 +32,24 @@ angular.module('index').config(['$routeProvider', '$locationProvider',
|
||||
$routeProvider.
|
||||
when('/', {
|
||||
title: 'application.title',
|
||||
bodyClassName: 'home',
|
||||
templateUrl: 'app/home/templates/home.html',
|
||||
controller: 'homeController'
|
||||
}).
|
||||
when('/manage/', {
|
||||
title: 'application.title',
|
||||
bodyClassName: 'manage',
|
||||
templateUrl: 'app/manage/templates/manage.html',
|
||||
controller: 'manageController'
|
||||
}).
|
||||
when('/login/', {
|
||||
title: 'application.title',
|
||||
bodyClassName: 'login',
|
||||
templateUrl: 'app/login/templates/login.html',
|
||||
controller: 'loginController'
|
||||
}).
|
||||
when('/client/:type/:id/:params?', {
|
||||
bodyClassName: 'client',
|
||||
templateUrl: 'app/client/templates/client.html',
|
||||
controller: 'clientController'
|
||||
}).
|
||||
|
@@ -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 || '';
|
||||
|
||||
});
|
||||
|
||||
}]);
|
||||
|
@@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<link rel="stylesheet" type="text/css" href="guacamole.css">
|
||||
</head>
|
||||
<body>
|
||||
<body ng-class="page.bodyClassName">
|
||||
<div id="content" ng-view>
|
||||
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user