Feature/release cleanup (#597)

* Deselect all after bulk operations complete.

* Implemented a way to trigger selection code on mobile.

* When selection mode is active, make the clickable area the whole image.

* Series detail shouldn't use gutters for card layout as it can cause skewing on mobile

* Long press on card items to trigger the selection on mobile

* Code cleanup

* One more

* Misread the code issue
This commit is contained in:
Joseph Milazzo 2021-09-26 05:40:52 -07:00 committed by GitHub
parent 5ceb74e210
commit 5e2606b0de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 25 deletions

View file

@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { Observable, Subject } from 'rxjs';
import { finalize, take, takeUntil, takeWhile } from 'rxjs/operators';
@ -118,6 +118,24 @@ export class CardItemComponent implements OnInit, OnDestroy {
this.onDestroy.complete();
}
prevTouchTime: number = 0;
@HostListener('touchstart', ['$event'])
onTouchStart(event: TouchEvent) {
this.prevTouchTime = event.timeStamp;
}
@HostListener('touchend', ['$event'])
onTouchEnd(event: TouchEvent) {
if (event.timeStamp - this.prevTouchTime >= 200) {
this.handleSelection();
event.stopPropagation();
event.preventDefault();
}
this.prevTouchTime = 0;
}
handleClick(event?: any) {
this.clicked.emit(this.title);
}