From e77489aa3b3e75d77e45f70c5981b1fbaef4bb87 Mon Sep 17 00:00:00 2001 From: balazs Date: Mon, 21 Jan 2019 17:24:02 +0100 Subject: [PATCH] Fix flickering bug --- src/app/dashboard/dashboard.component.html | 2 +- src/app/dashboard/dashboard.component.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index d636a65..2890300 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -18,7 +18,7 @@ diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 7fa86eb..b24d865 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -26,6 +26,7 @@ export class DashboardComponent implements OnInit, OnDestroy { layout: string = config.dashboard.currentLayout; hideMessages: boolean = config.dashboard.hideMessages; iframeUrl: string = config.dashboard.iframeUrl; + actualIframeUrl: string = this.iframeUrl; selectedTerminalMenuItem: string = config.dashboard.terminalOrConsole; command_handlers = { @@ -117,6 +118,7 @@ export class DashboardComponent implements OnInit, OnDestroy { reloadIframe() { setTimeout(() => { + console.log('reload timeout'); this.webiframe.nativeElement.contentWindow.location.reload(true); }); } @@ -143,10 +145,14 @@ export class DashboardComponent implements OnInit, OnDestroy { } iframeLoad(): void { - this.iframeUrl = this.webiframe.nativeElement.contentDocument.location.href.replace(document.baseURI, '/'); + if (this.webiframe) { + this.actualIframeUrl = this.webiframe.nativeElement.contentWindow.frames.location.pathname; + console.log('load'); + } } changeIframeURL() { - this.webiframe.nativeElement.contentDocument.location.href = document.baseURI + this.urlbar.nativeElement.value.substr(1); + this.webiframe.nativeElement.contentWindow.frames.location.pathname = this.actualIframeUrl; + console.log('change url'); } }