ov-components: refactor leave button implementation for improved template handling

master
Carlos Santos 2025-09-19 14:52:01 +02:00
parent 6da901e7bb
commit 4654c48f22
2 changed files with 16 additions and 17 deletions

View File

@ -199,17 +199,17 @@
<!-- Leave session button -->
@if (showLeaveButtonDirect()) {
@if (toolbarLeaveButtonTemplate) {
<ng-container *ngTemplateOutlet="toolbarLeaveButtonTemplate"></ng-container>
} @else {
<button
mat-icon-button
(click)="onLeaveClick()"
id="leave-btn"
[class.mobile-btn]="isMobileView()"
matTooltip="{{ 'TOOLBAR.LEAVE' | translate }}"
>
<mat-icon>call_end</mat-icon>
</button>
}
<button
mat-icon-button
(click)="onLeaveClick()"
id="leave-btn"
[class.mobile-btn]="isMobileView()"
matTooltip="{{ 'TOOLBAR.LEAVE' | translate }}"
>
<mat-icon>call_end</mat-icon>
</button>
}
@if (toolbarLeaveButtonTemplate) {
<ng-container *ngTemplateOutlet="toolbarLeaveButtonTemplate"></ng-container>
}

View File

@ -223,13 +223,12 @@ export class ParticipantPanelAfterLocalParticipantDirective {
}
/**
* The ***ovLeaveButton** directive allows you to replace the default leave button with a custom template.
* Use this directive to provide your own button, confirm dialogs, or any custom leave logic while keeping
* the internal leave flow intact.
* The ***ovLeaveButton** directive allows you to inject a custom leave button template. You can use the toolbarLeaveButton = false for
* replacing the default leave button with your custom one.
*
* Usage example:
* ```html
* <ov-videoconference>
* <ov-videoconference [toolbarLeaveButton]="false">
* <ng-container *ovLeaveButton>
* <button class="my-leave-button" (click)="customLeave()">
* Leave meeting