Spaces:
Paused
Paused
Download web/extensions/core/invertMenuScrolling.js from brunvelop/ComfyUI: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/spaces/brunvelop/ComfyUI/resolve/refs%2Fpr%2F1/web/extensions/core/invertMenuScrolling.js
- Command line
-
hf download hf://spaces/brunvelop/ComfyUI@refs/pr/1/web/extensions/core/invertMenuScrolling.js
-
curl -L -o invertMenuScrolling.js https://huggingface.co/spaces/brunvelop/ComfyUI/resolve/refs%2Fpr%2F1/web/extensions/core/invertMenuScrolling.js
805 Bytes
| import { app } from "../../scripts/app.js"; | |
| // Inverts the scrolling of context menus | |
| const id = "Comfy.InvertMenuScrolling"; | |
| app.registerExtension({ | |
| name: id, | |
| init() { | |
| const ctxMenu = LiteGraph.ContextMenu; | |
| 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; | |
| } | |
| }, | |
| }); | |
| }, | |
| }); | |