mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
25 lines
754 B
JavaScript
25 lines
754 B
JavaScript
import IDraggableTemplate from "./IDraggableTemplate.js"
|
|
|
|
/**
|
|
* @typedef {import("../element/IDraggableElement.js").default} IDraggableElement
|
|
* @typedef {import("lit").PropertyValues} PropertyValues
|
|
*/
|
|
|
|
/**
|
|
* @template {IDraggableElement} T
|
|
* @extends {IDraggableTemplate<T>}
|
|
*/
|
|
export default class IDraggablePositionedTemplate extends IDraggableTemplate {
|
|
|
|
/** @param {PropertyValues} changedProperties */
|
|
update(changedProperties) {
|
|
super.update(changedProperties)
|
|
if (changedProperties.has("locationX")) {
|
|
this.element.style.left = `${this.element.locationX}px`
|
|
}
|
|
if (changedProperties.has("locationY")) {
|
|
this.element.style.top = `${this.element.locationY}px`
|
|
}
|
|
}
|
|
}
|