mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 06:05:45 +08:00
Dropdown implementation, switch refactoring
* Various fixes * Fix tests * Dropdown names deduced from pin names * Remove update callbacks * Fix double pins issue * return undefined if not switch
This commit is contained in:
@@ -13,7 +13,6 @@ import Utility from "../Utility.js"
|
||||
import VariableAccessNodeTemplate from "../template/node/VariableAccessNodeTemplate.js"
|
||||
import VariableConversionNodeTemplate from "../template/node/VariableConversionNodeTemplate.js"
|
||||
import VariableOperationNodeTemplate from "../template/node/VariableOperationNodeTemplate.js"
|
||||
import UnknownPinEntity from "../entity/UnknownPinEntity.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./IDraggableElement.js").DragEvent} DragEvent
|
||||
@@ -90,7 +89,8 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
// If selected, it will already drag, also must check if under nested comments, it must drag just once
|
||||
if (!this.selected && !this.#commentDragged) {
|
||||
this.#commentDragged = true
|
||||
this.addNextUpdatedCallbacks(() => this.#commentDragged = false)
|
||||
this.requestUpdate()
|
||||
this.updateComplete.then(() => this.#commentDragged = false)
|
||||
this.addLocation(...e.detail.value)
|
||||
}
|
||||
}
|
||||
@@ -193,11 +193,12 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
}
|
||||
}
|
||||
|
||||
getUpdateComplete() {
|
||||
return Promise.all([
|
||||
super.getUpdateComplete(),
|
||||
...this.getPinElements().map(pin => pin.updateComplete)
|
||||
]).then(() => true)
|
||||
async getUpdateComplete() {
|
||||
let result = await super.getUpdateComplete()
|
||||
for (const pin of this.getPinElements()) {
|
||||
result &&= await pin.updateComplete
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/** @param {NodeElement} commentNode */
|
||||
|
||||
Reference in New Issue
Block a user