mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-17 10:17:29 +08:00
Move entities decode methods to entities
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit"
|
||||
import Configuration from "../../Configuration"
|
||||
import ElementFactory from "../../element/ElementFactory"
|
||||
import ISelectableDraggableTemplate from "../ISelectableDraggableTemplate"
|
||||
import SVGIcon from "../../SVGIcon"
|
||||
@@ -34,7 +33,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return Configuration.nodeColor(this.element)
|
||||
return this.element.entity.nodeColor()
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -62,7 +61,7 @@ export default class NodeTemplate extends ISelectableDraggableTemplate {
|
||||
}
|
||||
|
||||
renderNodeIcon() {
|
||||
return Configuration.nodeIcon(this.element)
|
||||
return this.element.entity.nodeIcon()
|
||||
}
|
||||
|
||||
renderNodeName() {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { html, nothing } from "lit"
|
||||
import Configuration from "../../Configuration"
|
||||
import ITemplate from "../ITemplate"
|
||||
import MouseCreateLink from "../../input/mouse/MouseCreateLink"
|
||||
import SVGIcon from "../../SVGIcon"
|
||||
@@ -103,7 +102,7 @@ export default class PinTemplate extends ITemplate {
|
||||
/** @param {PropertyValues} changedProperties */
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties)
|
||||
this.element.style.setProperty("--ueb-pin-color-rgb", Configuration.pinColor(this.element).cssText)
|
||||
this.element.style.setProperty("--ueb-pin-color-rgb", this.element.entity.pinColor().cssText)
|
||||
this.#iconElement = this.element.querySelector(".ueb-pin-icon svg") ?? this.element
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user