Don't put classes on body

pull/245/head
Varun Patil 2022-11-23 03:03:06 -08:00
parent 29dfb834de
commit bf11924dfd
3 changed files with 8 additions and 5 deletions

View File

@ -298,7 +298,7 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) {
this.rows[rowIdx].virtualSticky = true; this.rows[rowIdx].virtualSticky = true;
this.resetTouchParams(); this.resetTouchParams();
document.body.classList.add("vue-touching"); globalThis.touchingPhoto = true;
this.touchAnchor = photo; this.touchAnchor = photo;
this.prevOver = photo; this.prevOver = photo;
@ -320,7 +320,7 @@ export default class SelectionManager extends Mixins(GlobalMixin, UserConfig) {
this.resetTouchParams(); this.resetTouchParams();
window.setTimeout(() => { window.setTimeout(() => {
if (!this.touchAnchor) document.body.classList.remove("vue-touching"); if (!this.touchAnchor) globalThis.touchingPhoto = false;
}, 1000); }, 1000);
} }

View File

@ -232,7 +232,7 @@ export default class Photo extends Mixins(GlobalMixin) {
contextmenu(e: Event) { contextmenu(e: Event) {
// user is trying to select the photo // user is trying to select the photo
if (document.body.classList.contains("vue-touching")) { if (globalThis.touchingPhoto) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }
@ -298,7 +298,7 @@ $icon-size: $icon-half-size * 2;
cursor: pointer; cursor: pointer;
display: none; display: none;
body:not(.vue-touching) .p-outer:hover > & { .p-outer:hover > & {
display: flex; display: flex;
} }
@ -411,7 +411,7 @@ div.img-outer {
display: none; display: none;
transition: border-radius 0.1s ease-in; transition: border-radius 0.1s ease-in;
body:not(.vue-touching) .p-outer:not(.selected):hover > & { .p-outer:not(.selected):hover > & {
display: block; display: block;
} }
} }

View File

@ -39,8 +39,11 @@ declare global {
var editDate: (photo: IPhoto) => void; var editDate: (photo: IPhoto) => void;
var currentViewerPhoto: IPhoto; var currentViewerPhoto: IPhoto;
var touchingPhoto: boolean;
} }
globalThis.vuerouter = router; globalThis.vuerouter = router;
globalThis.touchingPhoto = false;
Vue.use(VueVirtualScroller); Vue.use(VueVirtualScroller);