Browse Source

fix: Restrict double click action to the title area.

https://github.com/ltdrdata/ComfyUI-Manager/issues/370
pull/376/head
Dr.Lt.Data 10 months ago
parent
commit
b1f613e649
  1. 2
      README.md
  2. 2
      __init__.py
  3. 4
      js/node_fixer.js

2
README.md

@ -257,7 +257,7 @@ NODE_CLASS_MAPPINGS.update({
## Additional Feature
* Fix node(recreate): When right-clicking on a node and selecting `Fix node (recreate)`, you can recreate the node. The widget's values are reset, while the connections maintain those with the same names.
* It is used to correct errors in nodes of old workflows created before, which are incompatible with the version changes of custom nodes.
* Double-Click: You can set the double click behavior of nodes in the ComfyUI-Manager menu.
* Double-Click Node Title: You can set the double click behavior of nodes in the ComfyUI-Manager menu.
* `Copy All Connections`, `Copy Input Connections`: Double-clicking a node copies the connections of the nearest node.
* This action targets the nearest node within a straight-line distance of 1000 pixels from the center of the node.
* In the case of `Copy All Connections`, it duplicates existing outputs, but since it does not allow duplicate connections, the existing output connections of the original node are disconnected.

2
__init__.py

@ -29,7 +29,7 @@ except:
print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.")
version = [2, 5]
version = [2, 5, 1]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
print(f"### Loading: ComfyUI-Manager ({version_str})")

4
js/node_fixer.js

@ -146,10 +146,10 @@ app.registerExtension({
async nodeCreated(node, app) {
let orig_dblClick = node.onDblClick;
node.onDblClick = () => {
node.onDblClick = function (e, pos, self) {
orig_dblClick?.apply?.(this, arguments);
if(!node.inputs && !node.outputs)
if((!node.inputs && !node.outputs) || pos[1] > 0)
return;
switch(double_click_policy) {

Loading…
Cancel
Save