Files
ueblueprint/js/template/IDraggablePositionedTemplate.js
barsdeveloper 365732a99c WIP
2024-12-03 22:15:17 +02:00

20 lines
605 B
JavaScript
Executable File

import IDraggableTemplate from "./IDraggableTemplate.js"
/**
* @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`
}
}
}