mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:21:31 +00:00
Make iframe toggleable
This commit is contained in:
parent
48a8facd50
commit
c07538dc13
@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tfw-web tao-grid-top-left"
|
<div class="tfw-web tao-grid-top-left"
|
||||||
[ngClass]="{'deploy-blur': deploying || polling}">
|
[ngClass]="{'deploy-blur': deploying || polling}">
|
||||||
<div class="iframe-container">
|
<div *ngIf="iframeUrl | async" class="iframe-container">
|
||||||
<div *ngIf="showUrlBar | async" class="urlbar-container">
|
<div *ngIf="showUrlBar | async" class="urlbar-container">
|
||||||
<button class="refresh btn btn-sm rounded-circle" (click)="reloadIframe()">↻</button>
|
<button class="refresh btn btn-sm rounded-circle" (click)="reloadIframe()">↻</button>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
|
@ -115,15 +115,15 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
this.terminalMenuItem.next(item);
|
this.terminalMenuItem.next(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollMessagesToBottom(): void {
|
scrollMessagesToBottom() {
|
||||||
const element = this.messages.nativeElement;
|
const element = this.messages.nativeElement;
|
||||||
// This must be done in the Angular event loop to avoid messing up
|
// This must be done in the Angular event loop to avoid messing up
|
||||||
// change detection (not in the template like ConsoleComponent does)
|
// change detection (not in the template like ConsoleComponent does)
|
||||||
element.scrollTop = element.scrollHeight;
|
element.scrollTop = element.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframeLoad(): void {
|
iframeLoad() {
|
||||||
if (this.webiframe) {
|
if (this.webiframe && this.iframeUrl.value) {
|
||||||
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
|
||||||
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
|
||||||
this.actualIframeUrl = niceURL;
|
this.actualIframeUrl = niceURL;
|
||||||
|
Loading…
Reference in New Issue
Block a user