Added more logging

This commit is contained in:
Sebastian Kupke 2022-11-08 13:42:50 +01:00
parent 89de46b0e6
commit 7965c8459b

View File

@ -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)
}
}