diff --git a/dist/iwmlib.js b/dist/iwmlib.js index 3c9f519..42752a8 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -2644,6 +2644,7 @@ * @param {object} [opts] - An options object. See the hammer documentation for more details. */ static on(types, elements, cb, opts = {}) { + opts = Object.assign({}, { }, opts); @@ -3814,6 +3815,38 @@ onMove = null } = {} ) { +<<<<<<< HEAD + 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', + event => this.preventPinch(event), + false + ); + stopEvents = false; + } else { + stopEvents = true; + } + } + this.stopEvents = stopEvents; + this.claimEvents = claimEvents; + if (touchAction !== null) { + Elements$1.setStyle(element, { touchAction }); + } + this.scatter = new Map(); + this.delegate = new InteractionMapper$1(element, this, { + useCapture, + mouseWheelElement: window + }); +======= +>>>>>>> a3f7eb0b3cc9f48cfee3ce6c45887bf25617d1bc let notchPosition = (switchPos && point.y < 50) ? "topCenter" : "bottomCenter"; @@ -4720,6 +4753,52 @@ } } +<<<<<<< HEAD + class DOMFlippable { + constructor(element, scatter, flip) { + // Set log to console.log or a custom log function + // define data structures to store our touchpoints in + + this.element = element; + this.flip = flip; + this.card = element.querySelector('.flipCard'); + this.front = element.querySelector('.front'); + this.back = element.querySelector('.back'); + this.flipped = false; + this.scatter = scatter; + this.onFrontFlipped = flip.onFrontFlipped; + this.onBackFlipped = flip.onBackFlipped; + this.onClose = flip.onClose; + this.onRemoved = flip.onRemoved; + this.onUpdate = flip.onUpdate; + + this.flipDuration = flip.flipDuration; + this.fadeDuration = flip.fadeDuration; + scatter.addTransformEventCallback(this.scatterTransformed.bind(this)); + console.log('lib.DOMFlippable', 5000); + TweenLite.set(this.element, { perspective: 5000 }); + TweenLite.set(this.card, { transformStyle: 'preserve-3d' }); + TweenLite.set(this.back, { rotationY: -180 }); + TweenLite.set([this.back, this.front], { + backfaceVisibility: 'hidden', + perspective: 5000 + }); + TweenLite.set(this.front, { visibility: 'visible' }); + this.infoBtn = element.querySelector('.infoBtn'); + this.backBtn = element.querySelector('.backBtn'); + this.closeBtn = element.querySelector('.closeBtn'); + /* Buttons are not guaranteed to exist. */ + if (this.infoBtn) { + InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start()); + this.enable(this.infoBtn); + } + if (this.backBtn) { + InteractionMapper$1.on('tap', this.backBtn, event => this.start()); + } + if (this.closeBtn) { + InteractionMapper$1.on('tap', this.closeBtn, event => this.close()); + this.enable(this.closeBtn); +======= /** * For a given zoom, a new scale is calculated, taking * min and max scale into account. @@ -4735,6 +4814,7 @@ if (scale < minScale) { scale = minScale; zoom = scale / this.scale; +>>>>>>> a3f7eb0b3cc9f48cfee3ce6c45887bf25617d1bc } if (scale > maxScale) { scale = maxScale; diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 8216093..b0fc860 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -5811,6 +5811,7 @@ * @param {object} [opts] - An options object. See the hammer documentation for more details. */ static on(types, elements, cb, opts = {}) { + opts = Object.assign({}, { }, opts); @@ -7577,7 +7578,6 @@ /* Buttons are not guaranteed to exist. */ if (this.infoBtn) { InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start()); - this.enable(this.infoBtn); } if (this.backBtn) { diff --git a/lib/flippable.html b/lib/flippable.html index e656c34..ed7d0b2 100644 --- a/lib/flippable.html +++ b/lib/flippable.html @@ -66,7 +66,7 @@ templates. diff --git a/lib/flippable.js b/lib/flippable.js index c85adb8..836c40c 100644 --- a/lib/flippable.js +++ b/lib/flippable.js @@ -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) { diff --git a/lib/interaction.js b/lib/interaction.js index 2b86c89..08867c2 100755 --- a/lib/interaction.js +++ b/lib/interaction.js @@ -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) diff --git a/lib/scatter.js b/lib/scatter.js index d5d1c25..02824e9 100644 --- a/lib/scatter.js +++ b/lib/scatter.js @@ -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',