Minor refactoring and fixes

This commit is contained in:
barsdeveloper
2022-12-26 14:10:25 +01:00
parent 3df33bfe05
commit a1ae7799a1
30 changed files with 651 additions and 536 deletions

View File

@@ -1,8 +1,6 @@
import IInput from "../IInput"
import Utility from "../../Utility"
/** @typedef {import("../../Blueprint").default} Blueprint */
/**
* @template {HTMLElement} T
* @extends {IInput<T>}
@@ -13,6 +11,7 @@ export default class IPointing extends IInput {
options.ignoreTranslateCompensate ??= false
options.movementSpace ??= blueprint.getGridDOMElement() ?? document.documentElement
super(target, blueprint, options)
/** @type {HTMLElement} */
this.movementSpace = options.movementSpace
}

View File

@@ -23,7 +23,7 @@ export default class MouseCreateLink extends IMouseClickDrag {
e => {
if (!this.enteredPin) {
this.linkValid = false
this.enteredPin = /** @type {PinElement} */ (e.target)
this.enteredPin = /** @type {PinElement} */(e.target)
const a = this.link.sourcePin ?? this.target // Remember target might have change
const b = this.enteredPin
if (
@@ -74,7 +74,7 @@ export default class MouseCreateLink extends IMouseClickDrag {
/** @type {LinkElement} */
this.link = /** @type {LinkElementConstructor} */(ElementFactory.getConstructor("ueb-link"))
.newObject(this.target, null)
this.blueprint.linksContainerElement.prepend(this.link)
this.blueprint.template.linksContainerElement.prepend(this.link)
this.link.setMessagePlaceNode()
this.#listenedPins = this.blueprint.querySelectorAll("ueb-pin")
this.#listenedPins.forEach(pin => {

View File

@@ -4,7 +4,7 @@ export default class Select extends IMouseClickDrag {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.selectorElement = this.blueprint.selectorElement
this.selectorElement = this.blueprint.template.selectorElement
}
startDrag() {