Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib

This commit is contained in:
2019-07-05 09:39:17 +02:00
6 changed files with 93 additions and 3 deletions
+6 -1
View File
@@ -66,7 +66,7 @@ templates.
</main>
<script class="doctest">
let scatterContainer = new DOMScatterContainer(main)
let scatterContainer = new DOMScatterContainer(main, {stopEvents: false})
if (Capabilities.supportsTemplate()) {
let flip = new DOMFlip(scatterContainer,
flipTemplate,
@@ -80,5 +80,10 @@ if (Capabilities.supportsTemplate()) {
else {
alert("Templates not supported, use Edge, Chrome, Safari or Firefox.")
}
setTimeout(function() {
const infoBtn = document.querySelector('.infoBtn')
InteractionMapper.on('tap', infoBtn, event => console.log('go'))
}, 2000)
</script>
</body>
-1
View File
@@ -404,7 +404,6 @@ export class DOMFlippable {
/* Buttons are not guaranteed to exist. */
if (this.infoBtn) {
InteractionMapper.on('tap', this.infoBtn, event => this.flip.start())
this.enable(this.infoBtn)
}
if (this.backBtn) {
+1
View File
@@ -1039,6 +1039,7 @@ export class InteractionMapper extends InteractionDelegate {
* @param {object} [opts] - An options object. See the hammer documentation for more details.
*/
static on(types, elements, cb, opts = {}) {
opts = Object.assign({}, {
}, opts)
+5
View File
@@ -873,6 +873,11 @@ export class DOMScatterContainer {
this.onCapture = null
this.element = element
if (stopEvents === 'auto') {
/*
The events have to be stopped in Safari, otherwise the whole page will be zoomed with
a pinch gesture (preventDefault in method preventPinch). In order to enable the
movement of scatter objects, the touchmove event has to be bound again.
*/
if (Capabilities.isSafari) {
document.addEventListener(
'touchmove',