mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
* Use npm to manage litegraph * Fix merge issues caused by BetaUI change * Switch to @comfyorg/litegraph * Fix various import * Fix css apply order bug * Fix package lock * Update litegraph * Update litegraph * Update browsertest expectations * Update test expectations [skip ci] * Fix default view screenshot --------- Co-authored-by: github-actions <github-actions@github.com>
39 lines
963 B
TypeScript
39 lines
963 B
TypeScript
import { LiteGraph } from "@comfyorg/litegraph";
|
|
import { app } from "../../scripts/app";
|
|
|
|
// Inverts the scrolling of context menus
|
|
|
|
const id = "Comfy.InvertMenuScrolling";
|
|
app.registerExtension({
|
|
name: id,
|
|
init() {
|
|
const ctxMenu = LiteGraph.ContextMenu;
|
|
const replace = () => {
|
|
// @ts-ignore
|
|
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;
|
|
}
|
|
},
|
|
});
|
|
},
|
|
});
|