Apply new code format standard (#217)

This commit is contained in:
Chenlei Hu
2024-07-25 10:10:18 -04:00
committed by GitHub
parent 19c70d95d3
commit e179f75387
121 changed files with 11898 additions and 11983 deletions

View File

@@ -1,38 +1,38 @@
import { LiteGraph } from "@comfyorg/litegraph";
import { app } from "../../scripts/app";
import { LiteGraph } from '@comfyorg/litegraph'
import { app } from '../../scripts/app'
// Inverts the scrolling of context menus
const id = "Comfy.InvertMenuScrolling";
const id = 'Comfy.InvertMenuScrolling'
app.registerExtension({
name: id,
init() {
const ctxMenu = LiteGraph.ContextMenu;
const ctxMenu = LiteGraph.ContextMenu
const replace = () => {
// @ts-ignore
LiteGraph.ContextMenu = function (values, options) {
options = options || {};
options = options || {}
if (options.scroll_speed) {
options.scroll_speed *= -1;
options.scroll_speed *= -1
} else {
options.scroll_speed = -0.1;
options.scroll_speed = -0.1
}
return ctxMenu.call(this, values, options);
};
LiteGraph.ContextMenu.prototype = ctxMenu.prototype;
};
return ctxMenu.call(this, values, options)
}
LiteGraph.ContextMenu.prototype = ctxMenu.prototype
}
app.ui.settings.addSetting({
id,
name: "Invert Menu Scrolling",
type: "boolean",
name: 'Invert Menu Scrolling',
type: 'boolean',
defaultValue: false,
onChange(value) {
if (value) {
replace();
replace()
} else {
LiteGraph.ContextMenu = ctxMenu;
LiteGraph.ContextMenu = ctxMenu
}
},
});
},
});
}
})
}
})