diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 04463542..ba64615a 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -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() { diff --git a/src/components/frame/Photo.vue b/src/components/frame/Photo.vue index b29c5bb4..47182f56 100644 --- a/src/components/frame/Photo.vue +++ b/src/components/frame/Photo.vue @@ -231,11 +231,8 @@ export default class Photo extends Mixins(GlobalMixin) { } contextmenu(e: Event) { - // user is trying to select the photo - if (globalThis.touchingPhoto) { - e.preventDefault(); - e.stopPropagation(); - } + e.preventDefault(); + e.stopPropagation(); } /** Start preview video */ @@ -298,8 +295,10 @@ $icon-size: $icon-half-size * 2; cursor: pointer; display: none; - .p-outer:hover > & { - display: flex; + @media (hover: hover) { + .p-outer:hover > & { + display: flex; + } } opacity: 0.7; @@ -411,8 +410,10 @@ div.img-outer { display: none; transition: border-radius 0.1s ease-in; - .p-outer:not(.selected):hover > & { - display: block; + @media (hover: hover) { + .p-outer:not(.selected):hover > & { + display: block; + } } } diff --git a/src/main.ts b/src/main.ts index 366fbc6b..05f7f8b3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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;