mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:31:33 +00:00
Merge pull request #34 from avatao-content/reload-iframe
Reload iframe handler added
This commit is contained in:
commit
cef95812eb
@ -31,7 +31,8 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
'layout': this.layoutHandler.bind(this),
|
||||
'hideMessages': this.hideMessagesHandler.bind(this),
|
||||
'terminalMenuItem': this.terminalMenuItemHandler.bind(this),
|
||||
'reloadFrontend': this.reloadFrontendHandlder.bind(this)
|
||||
'reloadFrontend': this.reloadFrontendHandlder.bind(this),
|
||||
'reloadIframe': this.reloadIframeHandler.bind(this)
|
||||
};
|
||||
|
||||
constructor(private deploymentNotificationService: DeploymentNotificationService,
|
||||
@ -101,6 +102,10 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
setTimeout(() => window.location.reload(), 2000);
|
||||
}
|
||||
|
||||
reloadIframeHandler(data: CommandMessage) {
|
||||
setTimeout(() => this.reloadIframeNoSubmit(), 200);
|
||||
}
|
||||
|
||||
setLayout(layout: string) {
|
||||
this.layout = layout;
|
||||
// We need to trigger a 'resize' event manually, otherwise editor stays collapsed
|
||||
@ -120,6 +125,13 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
reloadIframeNoSubmit() {
|
||||
// Sometimes it is needed to reload the iframe without resending the previous form data
|
||||
setTimeout(() => {
|
||||
this.webiframe.nativeElement.contentWindow.location = this.webiframe.nativeElement.contentWindow.location.href;
|
||||
})
|
||||
}
|
||||
|
||||
selectTerminalMenuItem(item: string) {
|
||||
if (!item.match('(terminal|console)')) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user