mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-24 16:04:44 +08:00
Comment now drag nodes
This commit is contained in:
@@ -2,10 +2,11 @@ import MouseMoveDraggable from "./MouseMoveDraggable"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../Blueprint").default} Blueprint
|
||||
* @typedef {import("../../element/ISelectableDraggableElement").default} ISelectableDraggableElement
|
||||
* @typedef {import("../../element/NodeElement").default} NodeElement
|
||||
* @typedef {import("../../template/CommentNodeTemplate").default} CommentNodeTemplate
|
||||
*/
|
||||
|
||||
/** @extends {MouseMoveDraggable<ISelectableDraggableElement>} */
|
||||
/** @extends {MouseMoveDraggable<NodeElement>} */
|
||||
export default class MouseMoveNodes extends MouseMoveDraggable {
|
||||
|
||||
startDrag() {
|
||||
@@ -23,6 +24,15 @@ export default class MouseMoveNodes extends MouseMoveDraggable {
|
||||
if (!this.started) {
|
||||
this.blueprint.unselectAll()
|
||||
this.target.setSelected(true)
|
||||
} else {
|
||||
this.blueprint.getNodes(true).forEach(node =>
|
||||
node.boundComments
|
||||
.filter(comment => !node.isInsideComment(comment))
|
||||
.forEach(comment => node.unbindFromComment(comment))
|
||||
)
|
||||
this.blueprint.getCommentNodes(true).forEach(comment =>
|
||||
/** @type {CommentNodeTemplate} */(comment.template).manageNodesBind()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user