From 4d1e4a07c046937bea25cbaea091d33f6d2385b1 Mon Sep 17 00:00:00 2001 From: jnyfil Date: Wed, 5 Jul 2023 18:12:46 +0900 Subject: [PATCH] Set auto-open option in context menu to default --- web/extensions/core/contextMenuOptions.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 web/extensions/core/contextMenuOptions.js diff --git a/web/extensions/core/contextMenuOptions.js b/web/extensions/core/contextMenuOptions.js new file mode 100644 index 000000000..f416af2dd --- /dev/null +++ b/web/extensions/core/contextMenuOptions.js @@ -0,0 +1,17 @@ +import {app} from "/scripts/app.js"; + +app.registerExtension({ + name: "Comfy.ContextMenuOptions", + init() { + const ctxMenu = LiteGraph.ContextMenu; + + LiteGraph.ContextMenu = function (values, options) { + options.autoopen = true; + const ctx = ctxMenu.call(this, values, options); + + return ctx; + } + + LiteGraph.ContextMenu.prototype = ctxMenu.prototype; + } +}); \ No newline at end of file