mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:41:34 +08:00
Various color picker improvements
This commit is contained in:
21
js/template/IDraggablePositionedTemplate.js
Normal file
21
js/template/IDraggablePositionedTemplate.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import IDraggableTemplate from "./IDraggableTemplate"
|
||||
|
||||
/** @typedef {import("../element/IDraggableElement").default} IDraggableElement */
|
||||
|
||||
/**
|
||||
* @template {IDraggableElement} T
|
||||
* @extends {IDraggableTemplate<T>}
|
||||
*/
|
||||
export default class IDraggablePositionedTemplate extends IDraggableTemplate {
|
||||
|
||||
/** @param {Map} 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`
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user