rtl configuraation (#4482)

This commit is contained in:
Eugenio Romano
2019-03-22 15:39:27 +00:00
committed by GitHub
parent f9e798a18c
commit 6a7a9666ad
5 changed files with 61 additions and 19 deletions

View File

@@ -1,2 +1,4 @@
<div [dir]="textOrientation" class="adf-demo-app-container" >
<router-outlet></router-outlet>
<router-outlet name="overlay"></router-outlet>
</div>

View File

@@ -7,6 +7,11 @@ router-outlet[name='overlay'] + * {
right: 0;
}
.adf-demo-app-container {
height: 100%;
width: 100%;
}
@media (max-width: 425px) {
adf-content-node-selector {
.adf-content-node-selector-content-list {

View File

@@ -16,7 +16,12 @@
*/
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
import { AuthenticationService, AlfrescoApiService, PageTitleService } from '@alfresco/adf-core';
import {
UserPreferencesService,
AuthenticationService,
AlfrescoApiService,
PageTitleService
} from '@alfresco/adf-core';
import { Router } from '@angular/router';
import { MatDialog } from '@angular/material';
@@ -28,14 +33,24 @@ import { MatDialog } from '@angular/material';
})
export class AppComponent implements OnInit {
textOrientation: string = 'ltr';
constructor(private pageTitleService: PageTitleService,
private alfrescoApiService: AlfrescoApiService,
private authenticationService: AuthenticationService,
private userPreferencesService: UserPreferencesService,
private router: Router,
private dialogRef: MatDialog) {
this.userPreferencesService.set('textOrientation', this.textOrientation);
}
ngOnInit() {
this.userPreferencesService.select('textOrientation').subscribe((textOrientation) => {
this.textOrientation = textOrientation;
});
this.pageTitleService.setTitle('title');
this.alfrescoApiService.getInstance().on('error', (error) => {

View File

@@ -76,6 +76,13 @@
<mat-icon>info</mat-icon>
</button>
</mat-list-item>
<mat-list-item (click)="textOrientationClick()">
<a matLine id="adf-page-orientation-conf">Page Orientation</a>
<button mat-icon-button>
<mat-icon>info</mat-icon>
</button>
</mat-list-item>
</mat-nav-list>
<div>

View File

@@ -85,6 +85,19 @@ export class ConfigEditorComponent {
this.indentCode();
}
textOrientationClick() {
this.isUserPreference = true;
this.userPreferenceProperty = 'textOrientation';
this.userPreferencesService.select( this.userPreferenceProperty).subscribe((textOrientation: number) => {
this.code = JSON.stringify(textOrientation);
this.field = 'textOrientation';
this.indentCode();
});
this.indentCode();
}
searchConfClick() {
this.isUserPreference = false;
this.code = JSON.stringify(this.appConfig.config['search']);