Fix tag selection not showing tags for multiple files

TG-76 #closed

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/6/head
trivernis 3 years ago
parent dd6107d1fd
commit bb676ba972
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -30,6 +30,7 @@ export class FilesTabComponent implements OnInit {
} else {
this.state.selectedCD.next(undefined);
}
console.debug(this.selectedFiles);
}
public getStateSelectedFile(): File | undefined {

@ -5,7 +5,7 @@
class="file-gallery-inner">
<cdk-virtual-scroll-viewport #virtualScrollGrid class="file-scroll" itemSize="260" maxBufferPx="2000"
minBufferPx="500">
<div *cdkVirtualFor="let rowEntry of partitionedGridEntries; trackByFileRowId">
<div *cdkVirtualFor="let rowEntry of partitionedGridEntries; trackBy: trackByFileRowId">
<div class="file-row">
<app-file-card
(clickEvent)="setSelectedFile($event.entry)"
@ -18,7 +18,9 @@
</cdk-virtual-scroll-viewport>
</div>
<app-file-context-menu #fileContextMenu (fileDeleted)="this.fileDeleted.emit($event)" (fileStatusChange)="this.onFileStatusChange()">
<app-file-context-menu #fileContextMenu
(fileDeleted)="this.fileDeleted.emit($event)"
(fileStatusChange)="this.onFileStatusChange()">
<button (click)="this.fileOpen.emit(fileContextMenu.files[0])"
*ngIf="fileContextMenu.files.length === 1"
content-before=""

@ -19,6 +19,7 @@ import {FileService} from "../../../../../services/file/file.service";
import {Selectable} from "../../../../../models/Selectable";
import {Key} from "w3c-keys";
import {BehaviorSubject} from "rxjs";
import {LoggingService} from "../../../../../services/logging/logging.service";
@Component({
selector: "app-file-grid",
@ -48,6 +49,7 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit {
private gridEntries: Selectable<File>[] = [];
constructor(
private logger: LoggingService,
private tabService: TabService,
private fileService: FileService,
) {
@ -88,12 +90,14 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit {
this.handleShiftSelect(clickedEntry);
} else {
clickedEntry.selected.next(!clickedEntry.selected.value);
if (!clickedEntry.selected) {
if (!clickedEntry.selected.value) {
this.logger.trace("File wasn't selected");
const index = this.selectedEntries.indexOf(clickedEntry);
if (index > -1) {
this.selectedEntries.splice(index, 1);
}
} else {
this.logger.trace("File was selected");
this.selectedEntries.push(clickedEntry);
}
}
@ -258,11 +262,13 @@ export class FileGridComponent implements OnChanges, OnInit, AfterViewInit {
private selectAll() {
this.selectedEntries = this.gridEntries;
this.gridEntries.forEach(g => g.select());
this.fileSelect.emit(this.selectedEntries.map(e => e.data));
}
private selectNone() {
this.selectedEntries = [];
this.gridEntries.forEach(g => g.unselect());
this.fileSelect.emit([]);
}
private handleArrowSelect(direction: "up" | "down" | "left" | "right") {

Loading…
Cancel
Save