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.rows[rowIdx].virtualSticky = true;
this.resetTouchParams(); this.resetTouchParams();
globalThis.touchingPhoto = true;
this.touchAnchor = photo; this.touchAnchor = photo;
this.prevOver = 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); if (this.touchTimer) this.clickPhoto(photo, {} as any, rowIdx);
this.resetTouchParams(); this.resetTouchParams();
window.setTimeout(() => {
if (!this.touchAnchor) globalThis.touchingPhoto = false;
}, 1000);
} }
private resetTouchParams() { private resetTouchParams() {

View File

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

View File

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