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> <h3>
{{"The page will be reload, can you acceptable?"|trans}} {{data.note}}
</h3> </h3>
<div style="float: right"> <div style="float: right">
<button mat-raised-button (click)="onNoClick()">{{"Cancel"|trans}}</button> <button mat-raised-button (click)="onNoClick()">{{data.cancel}}</button>
<button mat-raised-button color="primary" [mat-dialog-close]="selected" cdkFocusInitial>{{"Confirm"|trans}}</button> <button mat-raised-button color="primary" [mat-dialog-close]="true" cdkFocusInitial>{{data.confirm}}</button>
</div> </div>
...@@ -99,33 +99,43 @@ export class ElementNavComponent implements OnInit { ...@@ -99,33 +99,43 @@ export class ElementNavComponent implements OnInit {
break; break;
} }
case 'English': { case 'English': {
this.ChangeLanWarningDialog = this._dialog.open( const dialog = this._dialog.open(
ChangLanWarningDialogComponent, ChangLanWarningDialogComponent,
{ {
height: '200px', height: '200px',
width: '300px', width: '300px',
data: {
title: 'Warning',
note: 'The page will be reload, can you acceptable?',
cancel: 'Cancel',
confirm: 'Confirm',
},
}); });
this.ChangeLanWarningDialog.afterClosed().subscribe( dialog.afterClosed().subscribe(result => {
result => { if (result) {
if (result) { this.English();
this.English(); }
} });
});
break; break;
} }
case 'Chinese': { case 'Chinese': {
this.ChangeLanWarningDialog = this._dialog.open( const dialog = this._dialog.open(
ChangLanWarningDialogComponent, ChangLanWarningDialogComponent,
{ {
height: '200px', height: '200px',
width: '300px', width: '300px',
data: {
title: '警告',
note: '此页将被重载,是否确认?',
cancel: '取消',
confirm: '确认',
},
}); });
this.ChangeLanWarningDialog.afterClosed().subscribe( dialog.afterClosed().subscribe(result => {
result => { if (result) {
if (result) { this.Language('cn');
this.Language('cn'); }
} });
});
break; break;
} }
default: { default: {
...@@ -338,7 +348,8 @@ export class ElementNavComponent implements OnInit { ...@@ -338,7 +348,8 @@ export class ElementNavComponent implements OnInit {
}) })
export class ChangLanWarningDialogComponent 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() { 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