From 7965c8459baa0f01d75f6a36f3e4de551d908dc7 Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Tue, 8 Nov 2022 13:42:50 +0100 Subject: [PATCH] Added more logging --- lib/card/card.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/card/card.js b/lib/card/card.js index cbf0461..71ef892 100644 --- a/lib/card/card.js +++ b/lib/card/card.js @@ -533,6 +533,7 @@ export default class Card { popup.placeAt(position) InteractionMapper.on(this.interactionType, popup.element, () => { + alert(1) this._cleanup(context) }) @@ -1064,6 +1065,7 @@ export default class Card { // captured from the whole subcard. InteractionMapper.on(this.interactionType, zoomedFig, () => { + alert(2) this._cleanup(wrapper) }) @@ -1278,6 +1280,7 @@ export default class Card { }, }) + alert(3) InteractionMapper.off(zoomedFig) } } @@ -1327,7 +1330,9 @@ export default class Card { /* Removes the 'default' cleanup on the card */ clone.removeAttribute('onclick') + alert(4) InteractionMapper.on(this.interactionType, clone, () => { + alert(5) this._cleanup(context) }) @@ -1467,8 +1472,10 @@ export default class Card { if (enableNearestNeighborTaps) { //look for nearby popups on tap + alert(6) InteractionMapper.on('tap', indexbox, () => { // console.log('Tap handler called', editable) + alert(7) if (!editable) { this.findNearbyPopups(event, card) } @@ -1480,7 +1487,9 @@ export default class Card { // Use the 'tap' event for closing. // Otherwise the subcard cannot be closed, // when another subcard is touched. + alert(8) InteractionMapper.on('tap', iconClone, () => { + alert(9) if (editable) { let isDirty = mainController.askSaveNode() if (isDirty) { @@ -1662,6 +1671,7 @@ export default class Card { let handler = `Card.openIndexCard(event, '${url}')` if (this.debug) console.log('File has changed', target, handler) + alert(10) //TODO If this is required, it should be accessing the interaction type. target.setAttribute('onclick', handler) } @@ -2067,6 +2077,7 @@ export default class Card { * @memberof Card */ static registerEvent(context, types, element, callback) { + alert(11) InteractionMapper.on(types, element, callback) if (context._registeredEvents == null) context._registeredEvents = [] if (context._registeredEvents.indexOf(element) == -1) context._registeredEvents.push(element) @@ -2082,6 +2093,7 @@ export default class Card { */ static unregisterAllEvents(context) { let eventElements = this.getRegisteredEvents(context) + alert(12) InteractionMapper.off(eventElements) } }