mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:41:32 +00:00
Fix flickering bug
This commit is contained in:
parent
6d136c9279
commit
e77489aa3b
@ -18,7 +18,7 @@
|
||||
<input type="text"
|
||||
#urlbar
|
||||
class="urlbar"
|
||||
value="{{iframeUrl}}"
|
||||
value="{{actualIframeUrl}}"
|
||||
(keyup.enter)="changeIframeURL()">
|
||||
<button class="go" (click)="changeIframeURL()">G</button>
|
||||
</div>
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user