Fix sidebar node reloading issue (#2866)

[ADF-2186] Fix sidebar node reloading issue
This commit is contained in:
Popovics András 2018-01-23 14:48:00 +00:00 committed by Eugenio Romano
parent 4e434f7e11
commit c66115fe70
2 changed files with 11 additions and 1 deletions

View File

@ -84,7 +84,7 @@
matTooltip="{{ 'ADF_VIEWER.ACTIONS.INFO' | translate }}"
data-automation-id="toolbar-sidebar"
[color]="showSidebar ? 'accent' : 'default'"
(click)="showSidebar = !showSidebar">
(click)="toggleSidebar($event)">
<mat-icon>info_outline</mat-icon>
</button>
</ng-container>

View File

@ -267,6 +267,16 @@ export class ViewerComponent implements OnChanges {
}
}
toggleSidebar() {
this.showSidebar = !this.showSidebar;
if (this.showSidebar && this.fileNodeId) {
this.apiService.getInstance().nodes.getNodeInfo(this.fileNodeId)
.then((data: MinimalNodeEntryEntity) => {
this.sidebarTemplateContext.node = data;
});
}
}
private getDisplayName(name) {
return this.displayName || name;
}