Fixed taphandler problems.
This commit is contained in:
+8
-4
@@ -2,6 +2,7 @@
|
||||
/* global PDFJS Power1 */
|
||||
import { getId } from './utils.js'
|
||||
import { DOMScatter } from './scatter.js'
|
||||
import CardWrapper from './card/wrapper.js'
|
||||
|
||||
export class CardLoader {
|
||||
constructor(
|
||||
@@ -403,20 +404,23 @@ export class DOMFlippable {
|
||||
this.backBtn = element.querySelector('.backBtn')
|
||||
this.closeBtn = element.querySelector('.closeBtn')
|
||||
/* Buttons are not guaranteed to exist. */
|
||||
|
||||
if (scatter.tapDelegate == null) {
|
||||
let tapDelegate = new CardWrapper(element)
|
||||
scatter.tapDelegate = tapDelegate
|
||||
}
|
||||
if (this.infoBtn) {
|
||||
scatter.addTapListener(this.infoBtn, event => {
|
||||
scatter.tapDelegate.onTap(this.infoBtn, event => {
|
||||
this.flip.start()
|
||||
})
|
||||
this.enable(this.infoBtn)
|
||||
}
|
||||
if (this.backBtn) {
|
||||
scatter.addTapListener(this.backBtn, event => {
|
||||
scatter.tapDelegate.onTap(this.backBtn, event => {
|
||||
this.start()
|
||||
})
|
||||
}
|
||||
if (this.closeBtn) {
|
||||
scatter.addTapListener(this.closeBtn, event => {
|
||||
scatter.tapDelegate.onTap(this.closeBtn, event => {
|
||||
this.close()
|
||||
})
|
||||
this.enable(this.closeBtn)
|
||||
|
||||
Reference in New Issue
Block a user