fixed position for context menu (safari), removed fileselection on longpress

This commit is contained in:
Eike Ahmels 2021-02-27 14:34:43 +01:00 committed by Stefan Dej
parent b84fc03c91
commit be12d53c0e
3 changed files with 9 additions and 4 deletions

View File

@ -450,8 +450,8 @@
e?.preventDefault();
console.log(e);
this.contextMenu.shown = true;
this.contextMenu.x = undefined || e?.x || 0;
this.contextMenu.y = e?.clientY || e?.y || 0;
this.contextMenu.x = e?.clientX || e?.pageX || window.screenX / 2;
this.contextMenu.y = e?.clientY || e?.pageY || window.screenY / 2;
this.contextMenu.item = item;
this.$nextTick(() => {
this.contextMenu.shown = true

View File

@ -549,8 +549,8 @@
if (!this.contextMenu.shown) {
e?.preventDefault();
this.contextMenu.shown = true
this.contextMenu.x = e?.clientX || e?.x || 0
this.contextMenu.y = e?.clientY || e?.y || 0
this.contextMenu.x = e?.clientX || e?.pageX || window.screenX / 2;
this.contextMenu.y = e?.clientY || e?.pageY || window.screenY / 2;
this.contextMenu.item = item
this.$nextTick(() => {
this.contextMenu.shown = true

View File

@ -35,7 +35,12 @@ Vue.directive('longpress', {
if (pressTimer === null) {
pressTimer = setTimeout(() => {
// Run function
const before = el.style.userSelect;
el.style.userSelect = 'none';
handler(e)
setTimeout(() => {
el.style.userSelect = before;
}, 100);
}, 1000)
}
}