Added event parameter,

This commit is contained in:
2019-08-01 19:30:07 +02:00
parent e72836e0f7
commit db2badfc0d
4 changed files with 37 additions and 23 deletions
+26 -18
View File
@@ -2621,6 +2621,8 @@
onMouseWheel(event) {
if (this.capture(event) && this.target.onMouseWheel) {
this.target.onMouseWheel(event);
} else {
//console.warn('Target has no onMouseWheel callback')
}
}
@@ -2830,6 +2832,8 @@
}
if (this.target.onMouseWheel) {
this.target.onMouseWheel(event);
} else {
//console.warn('Target has no onMouseWheel callback', this.target)
}
}
}
@@ -5464,6 +5468,8 @@
Poppable.registrations = new Map();
/* eslint-disable no-console */
/** A Popup that shows text labels, images, or html
*/
class Popup$1 extends Poppable {
@@ -5645,6 +5651,7 @@
}
for (let key in content) {
console.log('using', key, this.loaded);
switch (key) {
case 'selector':
break
@@ -5756,7 +5763,7 @@
handleClose(e) {
let closing = this.closingEvent(e);
if (closing) {
this.close();
this.close(e);
} else {
this.setupCloseHandler();
}
@@ -5886,11 +5893,11 @@
/** Close and remove the Popup from the DOM tree.
*/
close() {
close(event) {
//console.log("Popup.close", this.closeCommand)
this.unregister(this.context);
if (this.closeCommand) {
this.closeCommand(this, () => this.remove());
this.closeCommand(this, () => this.remove(), event);
} else {
this.remove();
}
@@ -7984,6 +7991,8 @@
/** To avoid problems with relative URL paths, we use inline data URI to load svg icons. */
const enableNearestNeighborTaps = false;
/**
* A class that collects static methods to maintain the states and parts of
* EyeVisit like cards.
@@ -9452,6 +9461,16 @@
if (this.dynamicHeight) {
article.appendChild(iconClone);
}
if (enableNearestNeighborTaps) {
//look for nearby popups on tap
InteractionMapper.on('tap', indexbox, () => {
console.log('Tap handler called', editable);
if (!editable) {
this.findNearbyPopups(event, card);
}
});
}
// Use the 'tap' event for closing.
// Otherwise the subcard cannot be closed,
// when another subcard is touched.
@@ -10137,7 +10156,6 @@
}
/* eslint-disable no-console */
/* global TweenLite */
let _HighlightEnabled = true;
let _CircleIds = 0;
@@ -10356,14 +10374,14 @@
return
}
let image = svgRoot.querySelector('image');
// eslint-disable-next-line no-unused-vars
let [mask, maskImage] = Highlight$1._getSVGMask(target, {
svgRoot,
image
});
let center = Highlight$1._calculateCenterRelativeTo(target, image);
console.log("_calculateCenterRelativeTo", center);
console.log('_calculateCenterRelativeTo', center);
TweenLite.set(maskImage, {
transformOrigin: `${center.x} ${center.y}`
});
@@ -10379,7 +10397,7 @@
}
static toggleHighlight(node) {
console.log("toggleHighlight", Highlight$1._isExpanded(node));
console.log('toggleHighlight', Highlight$1._isExpanded(node));
if (Highlight$1._isExpanded(node)) {
Highlight$1.closeHighlight(node);
} else {
@@ -10506,18 +10524,8 @@
return target.classList.contains(Highlight$1.expandedClass)
}
static _setExpanded(target) {
target.classList.add(Highlight$1.expandedClass);
}
static _notExpanded(target) {
target.classList.remove(Highlight$1.expandedClass);
}
static closeHighlight(target, { animation = 0.5 } = {}) {
Highlight$1._notExpanded(target);
target.classList.remove(Highlight$1.expandedClass);
// eslint-disable-next-line no-unused-vars
let [mask, maskImage] = Highlight$1._getSVGMask(target);
console.log('Close Highlight', maskImage);
+4
View File
@@ -6042,6 +6042,8 @@
onMouseWheel(event) {
if (this.capture(event) && this.target.onMouseWheel) {
this.target.onMouseWheel(event);
} else {
//console.warn('Target has no onMouseWheel callback')
}
}
@@ -6251,6 +6253,8 @@
}
if (this.target.onMouseWheel) {
this.target.onMouseWheel(event);
} else {
//console.warn('Target has no onMouseWheel callback', this.target)
}
}
}