lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
24 lines • 808 B
JavaScript
import { TricklingEvent } from './TricklingEvent.js';
/**
* A {@link TricklingEvent} which cannot be targeted.
*
* @category Event
*/
export class UntargetableTricklingEvent extends TricklingEvent {
constructor(reversed = false) {
super(reversed);
this.target = null;
}
warnUntargetable(target) {
const subClass = this.constructor;
if (target !== null && !subClass.__lw_internal_targetWarned) {
subClass.__lw_internal_targetWarned = true;
console.warn(`"${subClass.type}" events cannot be targeted to a specific Widget. Target ignored`);
}
}
}
Object.defineProperty(UntargetableTricklingEvent, '__lw_internal_targetWarned', {
enumerable: false,
value: false
});
//# sourceMappingURL=UntargetableTricklingEvent.js.map