mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-16 10:54:42 +08:00
Fix script injection, small refactoring
This commit is contained in:
@@ -36,16 +36,6 @@ export default class GraphNode extends SelectableDraggable {
|
||||
connectedCallback() {
|
||||
const type = this.getAttribute("type")?.trim()
|
||||
super.connectedCallback()
|
||||
this.querySelectorAll(".ueb-node-input, .ueb-node-output").forEach(element => {
|
||||
this.dragLinkObjects.push(
|
||||
new DragLink(element, this.blueprint, {
|
||||
clickButton: 0,
|
||||
moveEverywhere: true,
|
||||
exitAnyButton: true,
|
||||
looseTarget: true
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
setLocation(value = [0, 0]) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import GraphElement from "./GraphElement"
|
||||
import PinTemplate from "../template/PinTemplate"
|
||||
import DragLink from "../input/DragLink"
|
||||
|
||||
export default class GraphPin extends GraphElement {
|
||||
|
||||
@@ -7,10 +8,15 @@ export default class GraphPin extends GraphElement {
|
||||
super(entity, new PinTemplate())
|
||||
/** @type {import("../entity/PinEntity").default} */
|
||||
this.entity
|
||||
/** @type {HTMLElement} */
|
||||
this.clickableElement = null
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
new DragLink(this.clickableElement, this.blueprint, {
|
||||
moveEverywhere: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Drag from "../input/Drag"
|
||||
import DragMove from "../input/DragMove"
|
||||
import GraphElement from "./GraphElement"
|
||||
|
||||
export default class SelectableDraggable extends GraphElement {
|
||||
@@ -19,7 +19,7 @@ export default class SelectableDraggable extends GraphElement {
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback()
|
||||
this.dragObject = new Drag(this, this.blueprint, {
|
||||
this.dragObject = new DragMove(this, this.blueprint, {
|
||||
looseTarget: true
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user