Fix touching selection tick (again)

pull/245/head
Varun Patil 2022-11-23 11:14:55 -08:00
parent dbb5e479a0
commit ab505900a2
3 changed files with 10 additions and 16 deletions

View File

@ -298,7 +298,6 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) {
this.rows[rowIdx].virtualSticky = true;
this.resetTouchParams();
globalThis.touchingPhoto = true;
this.touchAnchor = photo;
this.prevOver = photo;
@ -318,10 +317,6 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) {
if (this.touchTimer) this.clickPhoto(photo, {} as any, rowIdx);
this.resetTouchParams();
window.setTimeout(() => {
if (!this.touchAnchor) globalThis.touchingPhoto = false;
}, 1000);
}
private resetTouchParams() {

View File

@ -231,12 +231,9 @@ export default class Photo extends Mixins(GlobalMixin) {
}
contextmenu(e: Event) {
// user is trying to select the photo
if (globalThis.touchingPhoto) {
e.preventDefault();
e.stopPropagation();
}
}
/** Start preview video */
playVideo() {
@ -298,9 +295,11 @@ $icon-size: $icon-half-size * 2;
cursor: pointer;
display: none;
@media (hover: hover) {
.p-outer:hover > & {
display: flex;
}
}
opacity: 0.7;
&:hover,
@ -411,10 +410,12 @@ div.img-outer {
display: none;
transition: border-radius 0.1s ease-in;
@media (hover: hover) {
.p-outer:not(.selected):hover > & {
display: block;
}
}
}
> * {
@media (max-width: 768px) {

View File

@ -40,14 +40,12 @@ declare global {
var editDate: (photo: IPhoto) => void;
var currentViewerPhoto: IPhoto;
var touchingPhoto: boolean;
var windowInnerWidth: number; // cache
var windowInnerHeight: number; // cache
}
globalThis.vuerouter = router;
globalThis.touchingPhoto = false;
globalThis.windowInnerWidth = window.innerWidth;
globalThis.windowInnerHeight = window.innerHeight;