Bugfix: improved firefox mobile draggable solution

This commit is contained in:
djmaze 2021-02-24 10:41:24 +01:00
parent ae3bab4b35
commit 0696e20878
3 changed files with 4 additions and 11 deletions

View file

@ -92,7 +92,7 @@ ko.bindingHandlers.dragmessages = {
dragImage || (dragImage = elementById('messagesDragImage'));
if (data && dragImage && !ThemeStore.isMobile()) {
dragImage.querySelector('.text').textContent = data.uids.length;
let img = dragImage.querySelector('.icon-white');
let img = dragImage.querySelector('i');
img.classList.toggle('icon-copy', e.ctrlKey);
img.classList.toggle('icon-mail', !e.ctrlKey);

View file

@ -1,11 +1,8 @@
/*
.g-ui-user-select-none {
webkit-touch-callout: none;
user-select: none;
standard-user-select: none;
touch-callout: none;
-webkit-touch-callout: none;
}
*/
.g-ui-link {
color: #369;

View file

@ -93,7 +93,7 @@
if (dragSource) {
// get ready to start dragging
lastTouch = e;
e.preventDefault(); // prevent scrolling NOTE: this creates a bug that click will not work
// dragSource.style.userSelect = 'none';
// 1000 ms to wait, chrome on android triggers dragstart in 600
holdInterval = setTimeout(() => {
@ -130,10 +130,6 @@
touchend = e => {
if (dragSource) {
if (!isDragging) {
// touched the element but didn't drag, so simulate a click
dispatchEvent(lastTouch, 'click', e.target);
}
// finish dragging
allowDrop && 'touchcancel' !== e.type && dispatchEvent(lastTouch, 'drop', lastTarget);
reset();