Display notifications on hover over the button
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ import {EventService} from '../../../shared/websocket/event.service';
|
||||
templateUrl: './live-notification-box.component.html',
|
||||
styleUrl: './live-notification-box.component.scss',
|
||||
host: {
|
||||
class: 'config-panel hidden'
|
||||
class: 'config-panel'
|
||||
},
|
||||
})
|
||||
export class LiveNotificationBoxComponent {
|
||||
|
||||
@@ -30,29 +30,40 @@
|
||||
<li>
|
||||
<a class="topbar-item">
|
||||
<i class="pi pi-upload text-surface-700 dark:text-surface-100" (click)="openFileUploadDialog()"
|
||||
pTooltip="Upload book" tooltipPosition="top"></i>
|
||||
pTooltip="Upload Book" tooltipPosition="top"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="topbar-item">
|
||||
<i class="pi pi-cog text-surface-700 dark:text-surface-100" (click)="navigateToSettings()"
|
||||
pTooltip="Upload book" tooltipPosition="top"></i>
|
||||
pTooltip="Settings" tooltipPosition="top"></i>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<p-divider layout="vertical" />
|
||||
<li class="relative">
|
||||
<button type="button" class="topbar-item" enterActiveClass="animate-scalein" enterFromClass="hidden" leaveActiveClass="animate-fadeout" leaveToClass="hidden" pStyleClass="@next" [hideOnOutsideClick]="true">
|
||||
<i class="pi pi-wave-pulse" style="font-size: 1.5rem"
|
||||
[class.pulsating]="eventHighlight"
|
||||
[class.highlight]="eventHighlight"></i>
|
||||
<p-divider layout="vertical"/>
|
||||
<li class="relative" (mouseenter)="onHover(true)" (mouseleave)="onHover(false)">
|
||||
<button type="button" class="topbar-item"
|
||||
enterActiveClass="animate-scalein"
|
||||
enterFromClass="hidden"
|
||||
leaveActiveClass="animate-fadeout"
|
||||
leaveToClass="hidden"
|
||||
pStyleClass="@next"
|
||||
[hideOnOutsideClick]="true">
|
||||
<i class="pi pi-wave-pulse" style="font-size: 1.5rem" [class.pulsating]="eventHighlight" [class.highlight]="eventHighlight"></i>
|
||||
</button>
|
||||
<app-live-notification-box class="config-panel notification-box"></app-live-notification-box>
|
||||
<app-live-notification-box class="config-panel notification-box" *ngIf="isHovered"></app-live-notification-box>
|
||||
</li>
|
||||
<p-divider layout="vertical" />
|
||||
|
||||
<p-divider layout="vertical"/>
|
||||
<li class="relative">
|
||||
<button type="button" class="topbar-item config-item" enterActiveClass="animate-scalein" enterFromClass="hidden" leaveActiveClass="animate-fadeout" leaveToClass="hidden" pStyleClass="@next" [hideOnOutsideClick]="true">
|
||||
<button type="button"
|
||||
class="topbar-item config-item"
|
||||
enterActiveClass="animate-scalein"
|
||||
enterFromClass="hidden"
|
||||
leaveActiveClass="animate-fadeout"
|
||||
leaveToClass="hidden"
|
||||
pStyleClass="@next" [hideOnOutsideClick]="true">
|
||||
<i class="pi pi-palette"></i>
|
||||
</button>
|
||||
<app-theme-configurator></app-theme-configurator>
|
||||
|
||||
@@ -8,7 +8,7 @@ import {TooltipModule} from 'primeng/tooltip';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {InputTextModule} from 'primeng/inputtext';
|
||||
import {BookSearcherComponent} from '../../../book/components/book-searcher/book-searcher.component';
|
||||
import {NgClass} from '@angular/common';
|
||||
import {NgClass, NgIf} from '@angular/common';
|
||||
import {EventService} from '../../../shared/websocket/event.service';
|
||||
import {Button} from 'primeng/button';
|
||||
import {StyleClass} from 'primeng/styleclass';
|
||||
@@ -32,7 +32,8 @@ import {BookUploaderComponent} from '../../../utilities/component/book-uploader/
|
||||
StyleClass,
|
||||
NgClass,
|
||||
Divider,
|
||||
LiveNotificationBoxComponent
|
||||
LiveNotificationBoxComponent,
|
||||
NgIf
|
||||
],
|
||||
})
|
||||
export class AppTopBarComponent implements OnDestroy {
|
||||
@@ -55,6 +56,11 @@ export class AppTopBarComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
isMenuVisible: boolean = true;
|
||||
isHovered: boolean = false;
|
||||
|
||||
onHover(hovered: boolean): void {
|
||||
this.isHovered = hovered;
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
this.isMenuVisible = !this.isMenuVisible;
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
*ngIf="(libraryState$ | async)?.libraries as libraries"
|
||||
class="flex flex-col gap-10 p-4 items-center justify-center min-w-[400px] max-w-[600px] w-full">
|
||||
|
||||
<p-dropdown
|
||||
<p-select
|
||||
[options]="libraries"
|
||||
optionLabel="name"
|
||||
placeholder="Select Library"
|
||||
[(ngModel)]="selectedLibrary"
|
||||
class="w-full"></p-dropdown>
|
||||
class="w-full"></p-select>
|
||||
|
||||
<p-dropdown
|
||||
<p-select
|
||||
[options]="selectedLibrary?.paths"
|
||||
optionLabel="path"
|
||||
placeholder="Select Upload Location"
|
||||
[(ngModel)]="selectedPath"
|
||||
[disabled]="!selectedLibrary"
|
||||
class="w-full"></p-dropdown>
|
||||
class="w-full"></p-select>
|
||||
|
||||
<p-fileupload
|
||||
#fu
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { FileProgressEvent, FileSendEvent, FileUpload, FileUploadErrorEvent, FileUploadEvent } from 'primeng/fileupload';
|
||||
import { Button } from 'primeng/button';
|
||||
import { LibraryService } from '../../../book/service/library.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { LibraryState } from '../../../book/model/state/library-state.model';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { DropdownModule } from 'primeng/dropdown';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Library, LibraryPath } from '../../../book/model/library.model';
|
||||
import { MessageService } from 'primeng/api';
|
||||
import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
||||
import {Component, inject} from '@angular/core';
|
||||
import {FileProgressEvent, FileSendEvent, FileUpload, FileUploadErrorEvent, FileUploadEvent} from 'primeng/fileupload';
|
||||
import {Button} from 'primeng/button';
|
||||
import {LibraryService} from '../../../book/service/library.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {LibraryState} from '../../../book/model/state/library-state.model';
|
||||
import {AsyncPipe, NgIf} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {Library, LibraryPath} from '../../../book/model/library.model';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||
import {Select} from 'primeng/select';
|
||||
|
||||
@Component({
|
||||
selector: 'app-book-uploader',
|
||||
@@ -17,9 +17,9 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
||||
FileUpload,
|
||||
Button,
|
||||
AsyncPipe,
|
||||
DropdownModule,
|
||||
FormsModule,
|
||||
NgIf
|
||||
NgIf,
|
||||
Select
|
||||
],
|
||||
templateUrl: './book-uploader.component.html',
|
||||
styleUrl: './book-uploader.component.scss'
|
||||
|
||||
Reference in New Issue
Block a user