]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/menu/notification.component.html
Fix menu dropdowns
[github/Chocobozzz/PeerTube.git] / client / src / app / menu / notification.component.html
index 890b086f1f71cbb1ad6c0f5f62522fd6079b0e3d..921d7643f1828b405f7a4ee27be3dc64652fa7f2 100644 (file)
@@ -1,15 +1,21 @@
-<div
-  [ngbPopover]="popContent" autoClose="outside" placement="bottom" container={this} popoverClass="popover-notifications"
-  i18n-title title="View your notifications" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }"
+<ng-template #notificationNumber>
+  <div *ngIf="unreadNotifications > 0 && unreadNotifications < 100" class="unread-notifications">{{ unreadNotifications }}</div>
+  <div *ngIf="unreadNotifications >= 100" class="unread-notifications">99+</div>
+</ng-template>
+
+<button
+  [ngbPopover]="popContent" autoClose="outside" placement="bottom" container="body" popoverClass="popover-notifications"
+  i18n-title title="View your notifications"
+  class="border-0 text-start" [ngClass]="{ 'notification-inbox-popover': true, 'shown': opened, 'hidden': isInMobileView }"
   #popover="ngbPopover" (shown)="onPopoverShown()" (hidden)="onPopoverHidden()"
 >
-  <div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div>
+  <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
 
   <my-global-icon iconName="bell"></my-global-icon>
-</div>
+</button>
 
 <div *ngIf="isInMobileView" i18n-title title="View your notifications" class="notification-inbox-link">
-  <div *ngIf="unreadNotifications > 0" class="unread-notifications">{{ unreadNotifications }}</div>
+  <ng-container *ngTemplateOutlet="notificationNumber"></ng-container>
 
   <a routerLink="/my-account/notifications" routerLinkActive="active" #link (click)="onNavigate(link)">
     <my-global-icon iconName="bell"></my-global-icon>