Another round of bugfixes (#3707)
This commit is contained in:
parent
cbb97208b8
commit
93dc6534fc
32 changed files with 412 additions and 335 deletions
|
|
@ -2,15 +2,15 @@
|
|||
@if (items.length > virtualizeAfter) {
|
||||
<div class="example-list list-group-flush">
|
||||
<virtual-scroller #scroll [items]="items" [bufferAmount]="BufferAmount" [parentScroll]="parentScroll">
|
||||
<div class="example-box" *ngFor="let item of scroll.viewPortItems; index as i; trackBy: trackByIdentity">
|
||||
|
||||
<div class="d-flex list-container">
|
||||
<ng-container [ngTemplateOutlet]="handle" [ngTemplateOutletContext]="{ $implicit: item, idx: i, isVirtualized: true }"></ng-container>
|
||||
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item, idx: i }"></ng-container>
|
||||
|
||||
<ng-container [ngTemplateOutlet]="removeBtn" [ngTemplateOutletContext]="{$implicit: item, idx: i}"></ng-container>
|
||||
@for (item of scroll.viewPortItems; track trackByIdentity(i, item); let i = $index) {
|
||||
<div class="example-box">
|
||||
<div class="d-flex list-container">
|
||||
<ng-container [ngTemplateOutlet]="handle" [ngTemplateOutletContext]="{ $implicit: item, idx: i, isVirtualized: true }"></ng-container>
|
||||
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item, idx: i }"></ng-container>
|
||||
<ng-container [ngTemplateOutlet]="removeBtn" [ngTemplateOutletContext]="{$implicit: item, idx: i}"></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</virtual-scroller>
|
||||
</div>
|
||||
} @else {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
TrackByFunction
|
||||
} from '@angular/core';
|
||||
import {VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller';
|
||||
import {NgClass, NgFor, NgTemplateOutlet} from '@angular/common';
|
||||
import {NgClass, NgTemplateOutlet} from '@angular/common';
|
||||
import {TranslocoDirective} from "@jsverse/transloco";
|
||||
import {BulkSelectionService} from "../../../cards/bulk-selection.service";
|
||||
import {FormsModule} from "@angular/forms";
|
||||
|
|
@ -36,13 +36,14 @@ export interface ItemRemoveEvent {
|
|||
templateUrl: './draggable-ordered-list.component.html',
|
||||
styleUrls: ['./draggable-ordered-list.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [VirtualScrollerModule, NgFor, NgTemplateOutlet, CdkDropList, CdkDrag,
|
||||
imports: [VirtualScrollerModule, NgTemplateOutlet, CdkDropList, CdkDrag,
|
||||
CdkDragHandle, TranslocoDirective, NgClass, FormsModule]
|
||||
})
|
||||
export class DraggableOrderedListComponent {
|
||||
|
||||
protected readonly bulkSelectionService = inject(BulkSelectionService);
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
private readonly cdRef = inject(ChangeDetectorRef);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +85,7 @@ export class DraggableOrderedListComponent {
|
|||
return Math.min(this.items.length / 20, 20);
|
||||
}
|
||||
|
||||
constructor(private readonly cdRef: ChangeDetectorRef) {
|
||||
constructor() {
|
||||
this.bulkSelectionService.selections$.pipe(
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
).subscribe((s) => {
|
||||
|
|
|
|||
|
|
@ -252,6 +252,8 @@
|
|||
@defer (when activeTabId === TabID.Details; prefetch on idle) {
|
||||
<app-details-tab [metadata]="castInfo"
|
||||
[readingTime]="rlInfo"
|
||||
[suppressEmptyGenres]="true"
|
||||
[suppressEmptyTags]="true"
|
||||
[ageRating]="readingList.ageRating"/>
|
||||
}
|
||||
</ng-template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue