mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA] Header - custom color (#114)
* custom header color * use SecurityContext.STYLE
This commit is contained in:
committed by
Denys Vuika
parent
02b38d3050
commit
358ffe2197
@@ -5,6 +5,7 @@
|
|||||||
"build": "1234"
|
"build": "1234"
|
||||||
},
|
},
|
||||||
"logo": "/assets/images/alfresco-logo-white.svg",
|
"logo": "/assets/images/alfresco-logo-white.svg",
|
||||||
|
"headerColor": "#2196F3",
|
||||||
"languagePicker": false,
|
"languagePicker": false,
|
||||||
"document-list": {
|
"document-list": {
|
||||||
"supportedPageSizes": [
|
"supportedPageSizes": [
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<adf-toolbar class="app-menu">
|
<adf-toolbar class="app-menu" [style.background-color]="backgroundColor">
|
||||||
<adf-toolbar-title>
|
<adf-toolbar-title>
|
||||||
<a class="app-menu__title"
|
<a class="app-menu__title"
|
||||||
title="{{ appName }}"
|
title="{{ appName }}"
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
&.adf-toolbar {
|
&.adf-toolbar {
|
||||||
.mat-toolbar {
|
.mat-toolbar {
|
||||||
background-color: #2196F3;
|
background-color: inherit;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
min-height: $app-menu-height;
|
min-height: $app-menu-height;
|
||||||
height: $app-menu-height;
|
height: $app-menu-height;
|
||||||
|
@@ -15,7 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, ViewEncapsulation } from '@angular/core';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { Component, ViewEncapsulation, SecurityContext } from '@angular/core';
|
||||||
import { AppConfigService } from '@alfresco/adf-core';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -26,8 +27,12 @@ import { AppConfigService } from '@alfresco/adf-core';
|
|||||||
})
|
})
|
||||||
export class HeaderComponent {
|
export class HeaderComponent {
|
||||||
private defaultPath = '/assets/images/alfresco-logo-white.svg';
|
private defaultPath = '/assets/images/alfresco-logo-white.svg';
|
||||||
|
private defaultBackgroundColor = '#2196F3';
|
||||||
|
|
||||||
constructor(private appConfig: AppConfigService) {}
|
constructor(
|
||||||
|
private appConfig: AppConfigService,
|
||||||
|
private sanitizer: DomSanitizer
|
||||||
|
) {}
|
||||||
|
|
||||||
get appName(): string {
|
get appName(): string {
|
||||||
return <string>this.appConfig.get('application.name');
|
return <string>this.appConfig.get('application.name');
|
||||||
@@ -36,4 +41,9 @@ export class HeaderComponent {
|
|||||||
get logo() {
|
get logo() {
|
||||||
return this.appConfig.get('logo', this.defaultPath);
|
return this.appConfig.get('logo', this.defaultPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get backgroundColor() {
|
||||||
|
const color = this.appConfig.get('headerColor', this.defaultBackgroundColor);
|
||||||
|
return this.sanitizer.sanitize(SecurityContext.STYLE, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user