mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:11:32 +00:00
commit
ec289081c8
@ -160,12 +160,21 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
||||
|
||||
iframeLoad(): void {
|
||||
if (this.webiframe) {
|
||||
this.actualIframeUrl = this.webiframe.nativeElement.contentWindow.frames.location.pathname;
|
||||
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
||||
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
||||
this.actualIframeUrl = niceURL;
|
||||
}
|
||||
}
|
||||
|
||||
changeIframeURL() {
|
||||
this.webiframe.nativeElement.contentWindow.frames.location.pathname = this.urlbar.nativeElement.value;
|
||||
const userGivenValue = this.urlbar.nativeElement.value.trim();
|
||||
if(
|
||||
userGivenValue == '/' ||
|
||||
userGivenValue.startsWith('dashboard') ||
|
||||
userGivenValue.startsWith('/dashboard')
|
||||
)
|
||||
return;
|
||||
this.webiframe.nativeElement.contentWindow.frames.location.href = this.urlbar.nativeElement.value;
|
||||
}
|
||||
|
||||
pollingServerForIframeReload() {
|
||||
|
Loading…
Reference in New Issue
Block a user