Added event parameter,
This commit is contained in:
parent
e72836e0f7
commit
db2badfc0d
@ -4,8 +4,6 @@ circle {
|
||||
stroke-width: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
mask circle {
|
||||
stroke-width: 0;
|
||||
fill: white;
|
||||
|
44
dist/iwmlib.js
vendored
44
dist/iwmlib.js
vendored
@ -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
dist/iwmlib.pixi.js
vendored
4
dist/iwmlib.pixi.js
vendored
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
lib/popup.js
10
lib/popup.js
@ -1,3 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-case-declarations */
|
||||
/* eslint-disable no-unused-vars */
|
||||
import { Elements } from './utils.js'
|
||||
import Poppable from './poppable.js'
|
||||
|
||||
@ -182,6 +185,7 @@ export default class Popup extends Poppable {
|
||||
}
|
||||
|
||||
for (let key in content) {
|
||||
console.log('using', key, this.loaded)
|
||||
switch (key) {
|
||||
case 'selector':
|
||||
break
|
||||
@ -293,7 +297,7 @@ export default class Popup extends Poppable {
|
||||
handleClose(e) {
|
||||
let closing = this.closingEvent(e)
|
||||
if (closing) {
|
||||
this.close()
|
||||
this.close(e)
|
||||
} else {
|
||||
this.setupCloseHandler()
|
||||
}
|
||||
@ -423,11 +427,11 @@ export default class Popup extends Poppable {
|
||||
|
||||
/** 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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user