Commit 72f139d1 authored by zheng liu's avatar zheng liu

Merged in dev (pull request #92)

feat: update
parents 21d0a0e7 fb64474a
<h1 mat-dialog-title>{{"Warning"|trans}}</h1>
<h1 mat-dialog-title>{{data.title}}</h1>
<h3>
{{"The page will be reload, can you acceptable?"|trans}}
{{data.note}}
</h3>
<div style="float: right">
<button mat-raised-button (click)="onNoClick()">{{"Cancel"|trans}}</button>
<button mat-raised-button color="primary" [mat-dialog-close]="selected" cdkFocusInitial>{{"Confirm"|trans}}</button>
<button mat-raised-button (click)="onNoClick()">{{data.cancel}}</button>
<button mat-raised-button color="primary" [mat-dialog-close]="true" cdkFocusInitial>{{data.confirm}}</button>
</div>
......@@ -99,33 +99,43 @@ export class ElementNavComponent implements OnInit {
break;
}
case 'English': {
this.ChangeLanWarningDialog = this._dialog.open(
const dialog = this._dialog.open(
ChangLanWarningDialogComponent,
{
height: '200px',
width: '300px',
data: {
title: 'Warning',
note: 'The page will be reload, can you acceptable?',
cancel: 'Cancel',
confirm: 'Confirm',
},
});
this.ChangeLanWarningDialog.afterClosed().subscribe(
result => {
if (result) {
this.English();
}
});
dialog.afterClosed().subscribe(result => {
if (result) {
this.English();
}
});
break;
}
case 'Chinese': {
this.ChangeLanWarningDialog = this._dialog.open(
const dialog = this._dialog.open(
ChangLanWarningDialogComponent,
{
height: '200px',
width: '300px',
data: {
title: '警告',
note: '此页将被重载,是否确认?',
cancel: '取消',
confirm: '确认',
},
});
this.ChangeLanWarningDialog.afterClosed().subscribe(
result => {
if (result) {
this.Language('cn');
}
});
dialog.afterClosed().subscribe(result => {
if (result) {
this.Language('cn');
}
});
break;
}
default: {
......@@ -338,7 +348,8 @@ export class ElementNavComponent implements OnInit {
})
export class ChangLanWarningDialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<ChangLanWarningDialogComponent>) {
constructor(public dialogRef: MatDialogRef<ChangLanWarningDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
ngOnInit() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment