X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-custom-markup%2Fcustom-markup-container.component.ts;h=4e802b14dd0f20795294922dd20fc25d2645a460;hb=15a7eafb892441957ba7dd6fcbf556086fe5b2b3;hp=2ecdc0243dbe5833e11f3f55ab0f969722956a0a;hpb=f7894f09649b8ae4009d51790f1ac636c4fc4439;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts index 2ecdc0243..4e802b14d 100644 --- a/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts +++ b/client/src/app/shared/shared-custom-markup/custom-markup-container.component.ts @@ -3,14 +3,15 @@ import { CustomMarkupService } from './custom-markup.service' @Component({ selector: 'my-custom-markup-container', - templateUrl: './custom-markup-container.component.html', - styleUrls: [ './custom-markup-container.component.scss' ] + templateUrl: './custom-markup-container.component.html' }) export class CustomMarkupContainerComponent implements OnChanges { @ViewChild('contentWrapper') contentWrapper: ElementRef @Input() content: string + displayed = false + constructor ( private customMarkupService: CustomMarkupService ) { } @@ -20,8 +21,13 @@ export class CustomMarkupContainerComponent implements OnChanges { } private async buildElement () { - const element = await this.customMarkupService.buildElement(this.content) - this.contentWrapper.nativeElement.appendChild(element) - } + if (!this.content) return + + const { rootElement, componentsLoaded } = await this.customMarkupService.buildElement(this.content) + this.contentWrapper.nativeElement.appendChild(rootElement) + await componentsLoaded + + this.displayed = true + } }