- Simplify menu ellipsis button logic

- Hide download button based on permissions
This commit is contained in:
aditya.chandel
2025-02-17 01:36:05 -07:00
parent 377c6ef628
commit 0a906ab4f8
3 changed files with 28 additions and 29 deletions
@@ -28,35 +28,30 @@
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
</a>
<span *ngIf="(item.routerLink && !item.items) && item.visible !== false">
<ng-container *ngIf="(item.type === 'Library' || item.type === 'Shelf') && canManipulateLibrary">
<p-button
(click)="entitymenu.toggle($event)"
(mouseover)="hovered = true"
(mouseleave)="hovered = false"
[text]="true"
[outlined]="false"
[rounded]="true"
[label]="hovered ? '' : (item.bookCount$ | async)?.toString() || ''"
[icon]="hovered ? 'pi pi-ellipsis-v' : ''"
[style.width]="'30px'"
[style.height]="'30px'"
[style.display]="'flex'">
</p-button>
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
</ng-container>
<ng-container *ngIf="item.type === 'Library' || item.type === 'Shelf'">
<p-button
*ngIf="item.type !== 'Library' || canManipulateLibrary"
(click)="entitymenu.toggle($event)"
(mouseover)="hovered = true"
(mouseleave)="hovered = false"
[text]="true"
[outlined]="false"
[rounded]="true"
[label]="hovered ? '' : (item.bookCount$ | async)?.toString() || ''"
[icon]="hovered ? 'pi pi-ellipsis-v' : ''"
[style.width]="'30px'"
[style.height]="'30px'"
[style.display]="'flex'">
</p-button>
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
</ng-container>
<ng-container *ngIf="item.type === 'Library' && !canManipulateLibrary">
<p class="text-[var(--primary-color)] pr-1">
{{ (item.bookCount$ | async)?.toString() || '0' }}
</p>
</ng-container>
<ng-container *ngIf="item.type === 'All Books'">
<p class="text-[var(--primary-color)] pr-1">
{{ (item.bookCount$ | async)?.toString() || '0' }}
</p>
</ng-container>
</span>
<ng-container *ngIf="item.type === 'Library' && !canManipulateLibrary || item.type === 'All Books'">
<p class="text-[var(--primary-color)] pr-1">
{{ (item.bookCount$ | async)?.toString() || '0' }}
</p>
</ng-container>
</span>
</div>
<ul *ngIf="item.items && item.visible !== false" [@children]="submenuAnimation">