Преглед на файлове

Fix touch input issue on Chrome for Android (fixes #551).

tags/2.4.1
Matthew Petroff преди 6 години
родител
ревизия
2031720700
променени са 2 файла, в които са добавени 13 реда и са изтрити 8 реда
  1. +1
    -0
      src/css/pannellum.css
  2. +12
    -8
      src/js/pannellum.js

+ 1
- 0
src/css/pannellum.css Целия файл

@@ -17,6 +17,7 @@
outline: 0;
line-height: 1.4;
contain: content;
touch-action: none;
}

.pnlm-container * {


+ 12
- 8
src/js/pannellum.js Целия файл

@@ -482,13 +482,17 @@ function onImageLoad() {
container.addEventListener('blur', clearKeys, false);
}
document.addEventListener('mouseleave', onDocumentMouseUp, false);
dragFix.addEventListener('touchstart', onDocumentTouchStart, false);
dragFix.addEventListener('touchmove', onDocumentTouchMove, false);
dragFix.addEventListener('touchend', onDocumentTouchEnd, false);
dragFix.addEventListener('pointerdown', onDocumentPointerDown, false);
dragFix.addEventListener('pointermove', onDocumentPointerMove, false);
dragFix.addEventListener('pointerup', onDocumentPointerUp, false);
dragFix.addEventListener('pointerleave', onDocumentPointerUp, false);
if (document.documentElement.style.pointerAction === '' &&
document.documentElement.style.touchAction === '') {
dragFix.addEventListener('pointerdown', onDocumentPointerDown, false);
dragFix.addEventListener('pointermove', onDocumentPointerMove, false);
dragFix.addEventListener('pointerup', onDocumentPointerUp, false);
dragFix.addEventListener('pointerleave', onDocumentPointerUp, false);
} else {
dragFix.addEventListener('touchstart', onDocumentTouchStart, false);
dragFix.addEventListener('touchmove', onDocumentTouchMove, false);
dragFix.addEventListener('touchend', onDocumentTouchEnd, false);
}

// Deal with MS pointer events
if (window.navigator.pointerEnabled)
@@ -928,7 +932,7 @@ function onDocumentPointerMove(event) {
pointerCoordinates[i].clientY = event.clientY;
event.targetTouches = pointerCoordinates;
onDocumentTouchMove(event);
//event.preventDefault();
event.preventDefault();
return;
}
}


Зареждане…
Отказ
Запис