Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Added invert scrolling setting

pythongosssss4ed39cf03847
diff --git a/web/extensions/core/invertMenuScrolling.js b/web/extensions/core/invertMenuScrolling.js
new file mode 100644
index 000000000..34523d55c
--- /dev/null
+++ b/web/extensions/core/invertMenuScrolling.js
@@ -0,0 +1,36 @@
+import { app } from "/scripts/app.js";
+
+// Inverts the scrolling of context menus
+
+const id = "Comfy.InvertMenuScrolling";
+const ctxMenu = LiteGraph.ContextMenu;
+app.registerExtension({
+ name: id,
+ init() {
+ const replace = () => {
+ LiteGraph.ContextMenu = function (values, options) {
+ options = options || {};
+ if (options.scroll_speed) {
+ options.scroll_speed *= -1;
+ } else {
+ options.scroll_speed = -0.1;
+ }
+ return ctxMenu.call(this, values, options);
+ };
+ LiteGraph.ContextMenu.prototype = ctxMenu.prototype;
+ };
+ app.ui.settings.addSetting({
+ id,
+ name: "Invert Menu Scrolling",
+ type: "boolean",
+ defaultValue: false,
+ onChange(value) {
+ if (value) {
+ replace();
+ } else {
+ LiteGraph.ContextMenu = ctxMenu;
+ }
+ },
+ });
+ },
+});