Browse Source

Trigger click handler functions with touch input (fixes #861).

pull/883/head
Matthew Petroff 4 years ago
parent
commit
6075769935
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/js/pannellum.js

+ 10
- 0
src/js/pannellum.js View File

@@ -1800,6 +1800,16 @@ function createHotSpot(hs) {
div.addEventListener('click', function(e) {
hs.clickHandlerFunc(e, hs.clickHandlerArgs);
}, 'false');
if (document.documentElement.style.pointerAction === '' &&
document.documentElement.style.touchAction === '') {
div.addEventListener('pointerup', function(e) {
hs.clickHandlerFunc(e, hs.clickHandlerArgs);
}, false);
} else {
div.addEventListener('touchend', function(e) {
hs.clickHandlerFunc(e, hs.clickHandlerArgs);
}, false);
}
div.className += ' pnlm-pointer';
span.className += ' pnlm-pointer';
}


Loading…
Cancel
Save