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