Working on cards.
This commit is contained in:
@@ -17,11 +17,6 @@ export class CardWrapper extends Object {
|
||||
|
||||
handleClicks() {
|
||||
this.domNode.addEventListener('click', event => {
|
||||
console.log('handleClicks', event.isTrusted)
|
||||
/* Currently we cannot send synthesized click events to SVG elements without unwanted side effects.
|
||||
Therefore we make an exception and let the original click event through.
|
||||
*/
|
||||
|
||||
if (event.isTrusted) {
|
||||
Events.stop(event)
|
||||
if (this.triggerSVGClicks && this.isSVGNode(event.target)) {
|
||||
@@ -34,10 +29,6 @@ export class CardWrapper extends Object {
|
||||
|
||||
handleClicksAsTaps() {
|
||||
this.domNode.addEventListener('click', event => {
|
||||
console.log('handleClicksAsTaps', event.isTrusted)
|
||||
/* Currently we cannot send synthesized click events to SVG elements without unwanted side effects.
|
||||
Therefore we make an exception and let the original click event through.
|
||||
*/
|
||||
if (event.isTrusted) {
|
||||
Events.stop(event)
|
||||
|
||||
@@ -62,9 +53,7 @@ export class CardWrapper extends Object {
|
||||
if (this.tapNodes.has(node))
|
||||
return true
|
||||
for (let [selector, handler] of this.tapHandler.entries()) {
|
||||
console.log("selector", this.domNode.querySelectorAll(selector))
|
||||
for (let obj of this.domNode.querySelectorAll(selector)) {
|
||||
console.log("selector2", node, obj)
|
||||
if (node == obj) {
|
||||
return true
|
||||
}
|
||||
@@ -127,7 +116,6 @@ export class CardWrapper extends Object {
|
||||
/* https://stackoverflow.com/questions/49564905/is-it-possible-to-use-click-function-on-svg-tags-i-tried-element-click-on-a
|
||||
proposes the dispatchEvent solution. But this leads to problems in flippable.html hiding the back page.
|
||||
Therefore we use the original click event (see constructor). */
|
||||
console.log("simulateClick", node, node.ownerSVGElement)
|
||||
if (this.isSVGNode(node)) {
|
||||
if (this.triggerSVGClicks) {
|
||||
let click = new Event('click')
|
||||
@@ -160,7 +148,6 @@ export class CardWrapper extends Object {
|
||||
}
|
||||
|
||||
tap(event, calledBy='unknown') {
|
||||
console.log("tap", calledBy, event.alreadyTapped, event)
|
||||
if (event.isTrusted) {
|
||||
let node = this.nearestActive(event)
|
||||
this.nodeTapped(node, event)
|
||||
@@ -184,4 +171,3 @@ export class CardWrapper extends Object {
|
||||
}
|
||||
|
||||
}
|
||||
window.CardWrapper = CardWrapper
|
||||
|
||||
Reference in New Issue
Block a user