mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
24 lines
647 B
JavaScript
24 lines
647 B
JavaScript
export default class Context {
|
|
|
|
constructor(target, blueprint, options) {
|
|
/** @type {HTMLElement} */
|
|
this.target = target
|
|
/** @type {import("../Blueprint").default}" */
|
|
this.blueprint = blueprint
|
|
this.options = options
|
|
if (options?.wantsFocusCallback ?? false) {
|
|
let self = this
|
|
this.blueprint.addEventListener("blueprintfocus", _ => self.blueprintFocused())
|
|
this.blueprint.addEventListener("blueprintunfocus", _ => self.blueprintUnfocused())
|
|
}
|
|
}
|
|
|
|
blueprintFocused() {
|
|
console.log("focused")
|
|
}
|
|
|
|
blueprintUnfocused() {
|
|
}
|
|
|
|
}
|