switched to using ngprime multiselect in library and watchlist pages

This commit is contained in:
X4Lo committed 2024-09-10 19:00:49 +01:00
1 parent 4fbbc4b113
commit c5883cf6f5
14 files changed
+285 -233

No files matched your search

@@ -0,0 +1,24 @@
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[appStopScroll]',
})
export class StopScrollDirective {
constructor(private el: ElementRef) {}
@HostListener('wheel', ['$event'])
onWheel(event: WheelEvent) {
const element = this.el.nativeElement;
// Check if scrolling is at the top or bottom of the element
const atTop = element.scrollTop === 0;
const atBottom =
element.scrollHeight - element.scrollTop === element.clientHeight;
// Prevent scrolling the page if scrolling is within the dropdown
if ((atTop && event.deltaY < 0) || (atBottom && event.deltaY > 0)) {
event.stopPropagation();
event.preventDefault();
}
}
}
+7
View File
@@ -19,6 +19,7 @@ import { DynamicEntryListComponent } from './components/lists/dynamic-entry-list
import { NotificationPopupComponent } from './components/notification-popup/notification-popup.component';
import { MinutesFormatPipe } from './pipes/minutes-format/minutes-format.pipe';
import { TwoLinesGridComponent } from './components/lists/two-lines-grid/two-lines-grid.component';
import { StopScrollDirective } from './directives/stop-scroll.directive';
@NgModule({
imports: [
@@ -35,6 +36,9 @@ import { TwoLinesGridComponent } from './components/lists/two-lines-grid/two-lin
FloatFormatPipe,
MinutesFormatPipe,
// * directives
StopScrollDirective,
// ? modals
SeenModalComponent,
CollectionEditModalComponent,
@@ -52,6 +56,9 @@ import { TwoLinesGridComponent } from './components/lists/two-lines-grid/two-lin
FloatFormatPipe,
MinutesFormatPipe,
// * directives
StopScrollDirective,
FormsModule,
ReactiveFormsModule,