mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 05:32:55 +00:00 
			
		
		
		
	Fix dashboard.iframeUrl by keeping iframeUrl updated
This commit is contained in:
		@@ -100,7 +100,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  reloadIframeHandler(message: WebSocketMessage) {
 | 
					  reloadIframeHandler(message: WebSocketMessage) {
 | 
				
			||||||
    setTimeout(() => this.reloadIframeNoSubmit(), 200);
 | 
					    setTimeout(() => this.reloadIframe(), 200);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  setLayout(layout: string) {
 | 
					  setLayout(layout: string) {
 | 
				
			||||||
@@ -115,14 +115,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  reloadIframe() {
 | 
					  reloadIframe() {
 | 
				
			||||||
    setTimeout(() => {
 | 
					    setTimeout(() => {
 | 
				
			||||||
      this.webiframe.nativeElement.contentWindow.location.reload(true);
 | 
					      this.webiframe.nativeElement.contentWindow.frames.location.href = this.iframeUrl.value;
 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  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;
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -155,7 +148,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.webiframe.nativeElement.contentWindow.frames.location.href = this.urlbar.nativeElement.value;
 | 
					    this.iframeUrl.next(this.urlbar.nativeElement.value);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  reloadIframeWhenResponseOk() {
 | 
					  reloadIframeWhenResponseOk() {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user