Fixed flippable doctest.
This commit is contained in:
parent
fc6b30f03c
commit
0c190f1f76
7
dist/iwmlib.js
vendored
7
dist/iwmlib.js
vendored
@ -2638,6 +2638,7 @@
|
|||||||
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
||||||
*/
|
*/
|
||||||
static on(types, elements, cb, opts = {}) {
|
static on(types, elements, cb, opts = {}) {
|
||||||
|
|
||||||
opts = Object.assign({}, {
|
opts = Object.assign({}, {
|
||||||
|
|
||||||
}, opts);
|
}, opts);
|
||||||
@ -3754,6 +3755,11 @@
|
|||||||
this.onCapture = null;
|
this.onCapture = null;
|
||||||
this.element = element;
|
this.element = element;
|
||||||
if (stopEvents === 'auto') {
|
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) {
|
if (Capabilities.isSafari) {
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
'touchmove',
|
'touchmove',
|
||||||
@ -4744,7 +4750,6 @@
|
|||||||
/* Buttons are not guaranteed to exist. */
|
/* Buttons are not guaranteed to exist. */
|
||||||
if (this.infoBtn) {
|
if (this.infoBtn) {
|
||||||
InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start());
|
InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start());
|
||||||
|
|
||||||
this.enable(this.infoBtn);
|
this.enable(this.infoBtn);
|
||||||
}
|
}
|
||||||
if (this.backBtn) {
|
if (this.backBtn) {
|
||||||
|
2
dist/iwmlib.pixi.js
vendored
2
dist/iwmlib.pixi.js
vendored
@ -5805,6 +5805,7 @@
|
|||||||
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
||||||
*/
|
*/
|
||||||
static on(types, elements, cb, opts = {}) {
|
static on(types, elements, cb, opts = {}) {
|
||||||
|
|
||||||
opts = Object.assign({}, {
|
opts = Object.assign({}, {
|
||||||
|
|
||||||
}, opts);
|
}, opts);
|
||||||
@ -7615,7 +7616,6 @@
|
|||||||
/* Buttons are not guaranteed to exist. */
|
/* Buttons are not guaranteed to exist. */
|
||||||
if (this.infoBtn) {
|
if (this.infoBtn) {
|
||||||
InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start());
|
InteractionMapper$1.on('tap', this.infoBtn, event => this.flip.start());
|
||||||
|
|
||||||
this.enable(this.infoBtn);
|
this.enable(this.infoBtn);
|
||||||
}
|
}
|
||||||
if (this.backBtn) {
|
if (this.backBtn) {
|
||||||
|
@ -66,7 +66,7 @@ templates.
|
|||||||
|
|
||||||
</main>
|
</main>
|
||||||
<script class="doctest">
|
<script class="doctest">
|
||||||
let scatterContainer = new DOMScatterContainer(main)
|
let scatterContainer = new DOMScatterContainer(main, {stopEvents: false})
|
||||||
if (Capabilities.supportsTemplate()) {
|
if (Capabilities.supportsTemplate()) {
|
||||||
let flip = new DOMFlip(scatterContainer,
|
let flip = new DOMFlip(scatterContainer,
|
||||||
flipTemplate,
|
flipTemplate,
|
||||||
@ -80,5 +80,10 @@ if (Capabilities.supportsTemplate()) {
|
|||||||
else {
|
else {
|
||||||
alert("Templates not supported, use Edge, Chrome, Safari or Firefox.")
|
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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -404,7 +404,6 @@ export class DOMFlippable {
|
|||||||
/* Buttons are not guaranteed to exist. */
|
/* Buttons are not guaranteed to exist. */
|
||||||
if (this.infoBtn) {
|
if (this.infoBtn) {
|
||||||
InteractionMapper.on('tap', this.infoBtn, event => this.flip.start())
|
InteractionMapper.on('tap', this.infoBtn, event => this.flip.start())
|
||||||
|
|
||||||
this.enable(this.infoBtn)
|
this.enable(this.infoBtn)
|
||||||
}
|
}
|
||||||
if (this.backBtn) {
|
if (this.backBtn) {
|
||||||
|
@ -1032,6 +1032,7 @@ export class InteractionMapper extends InteractionDelegate {
|
|||||||
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
* @param {object} [opts] - An options object. See the hammer documentation for more details.
|
||||||
*/
|
*/
|
||||||
static on(types, elements, cb, opts = {}) {
|
static on(types, elements, cb, opts = {}) {
|
||||||
|
|
||||||
opts = Object.assign({}, {
|
opts = Object.assign({}, {
|
||||||
|
|
||||||
}, opts)
|
}, opts)
|
||||||
|
@ -887,6 +887,11 @@ export class DOMScatterContainer {
|
|||||||
this.onCapture = null
|
this.onCapture = null
|
||||||
this.element = element
|
this.element = element
|
||||||
if (stopEvents === 'auto') {
|
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) {
|
if (Capabilities.isSafari) {
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
'touchmove',
|
'touchmove',
|
||||||
|
Loading…
Reference in New Issue
Block a user