mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
Emit node-double-click event (#383)
* Emit node-double-click event * nit
This commit is contained in:
@@ -2500,6 +2500,11 @@ export class LGraphCanvas {
|
||||
node.onNodeTitleDblClick?.(e, pos, this)
|
||||
}
|
||||
node.onDblClick?.(e, pos, this)
|
||||
this.emitEvent({
|
||||
subType: "node-double-click",
|
||||
originalEvent: e,
|
||||
node,
|
||||
})
|
||||
this.processNodeDblClicked(node)
|
||||
}
|
||||
|
||||
|
||||
@@ -134,13 +134,6 @@ export interface LinkReleaseContextExtended {
|
||||
|
||||
export interface LiteGraphCanvasEvent extends CustomEvent<CanvasEventDetail> {}
|
||||
|
||||
export interface LiteGraphCanvasGroupEvent
|
||||
extends CustomEvent<{
|
||||
subType: "group-double-click"
|
||||
originalEvent: MouseEvent
|
||||
group: LGraphGroup
|
||||
}> {}
|
||||
|
||||
/** https://github.com/jagenjo/litegraph.js/blob/master/guides/README.md#lgraphnode */
|
||||
|
||||
export interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
|
||||
|
||||
@@ -48,6 +48,7 @@ export type CanvasEventDetail =
|
||||
| DragggingCanvasEventDetail
|
||||
| ReadOnlyEventDetail
|
||||
| GroupDoubleClickEventDetail
|
||||
| NodeDoubleClickEventDetail
|
||||
| EmptyDoubleClickEventDetail
|
||||
| ConnectingWidgetLinkEventDetail
|
||||
| EmptyReleaseEventDetail
|
||||
@@ -81,6 +82,11 @@ export interface GroupDoubleClickEventDetail extends OriginalEvent {
|
||||
group: LGraphGroup
|
||||
}
|
||||
|
||||
export interface NodeDoubleClickEventDetail extends OriginalEvent {
|
||||
subType: "node-double-click"
|
||||
node: LGraphNode
|
||||
}
|
||||
|
||||
export interface DragggingCanvasEventDetail {
|
||||
subType: "dragging-canvas"
|
||||
draggingCanvas: boolean
|
||||
|
||||
Reference in New Issue
Block a user