Quellcode durchsuchen

Allow touch scrolling when `dragable` is false (fixes #788).

tags/2.5.4
Matthew Petroff vor 5 Jahren
Ursprung
Commit
406d003e5c
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. +0
    -1
      src/css/pannellum.css
  2. +5
    -0
      src/js/pannellum.js

+ 0
- 1
src/css/pannellum.css Datei anzeigen

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


.pnlm-container * { .pnlm-container * {


+ 5
- 0
src/js/pannellum.js Datei anzeigen

@@ -933,6 +933,9 @@ var pointerIDs = [],
*/ */
function onDocumentPointerDown(event) { function onDocumentPointerDown(event) {
if (event.pointerType == 'touch') { if (event.pointerType == 'touch') {
// Only do something if the panorama is loaded
if (!loaded || !config.draggable)
return;
pointerIDs.push(event.pointerId); pointerIDs.push(event.pointerId);
pointerCoordinates.push({clientX: event.clientX, clientY: event.clientY}); pointerCoordinates.push({clientX: event.clientX, clientY: event.clientY});
event.targetTouches = pointerCoordinates; event.targetTouches = pointerCoordinates;
@@ -948,6 +951,8 @@ function onDocumentPointerDown(event) {
*/ */
function onDocumentPointerMove(event) { function onDocumentPointerMove(event) {
if (event.pointerType == 'touch') { if (event.pointerType == 'touch') {
if (!config.draggable)
return;
for (var i = 0; i < pointerIDs.length; i++) { for (var i = 0; i < pointerIDs.length; i++) {
if (event.pointerId == pointerIDs[i]) { if (event.pointerId == pointerIDs[i]) {
pointerCoordinates[i].clientX = event.clientX; pointerCoordinates[i].clientX = event.clientX;


Laden…
Abbrechen
Speichern