Revert "Enable ts-strict for invertMenuScrolling.ts (#1264)" (#1288)

This reverts commit 9388ee0705.
This commit is contained in:
Chenlei Hu
2024-10-24 02:37:40 +02:00
committed by GitHub
parent e25bbc19cb
commit afa619b7df

View File

@@ -1,3 +1,4 @@
// @ts-strict-ignore
import { LiteGraph } from '@comfyorg/litegraph'
import { app } from '../../scripts/app'
@@ -9,22 +10,17 @@ app.registerExtension({
init() {
const ctxMenu = LiteGraph.ContextMenu
const replace = () => {
type CtxMenuConstructorArgs = ConstructorParameters<typeof ctxMenu>
class InvertContextMenu extends ctxMenu {
constructor(
values: CtxMenuConstructorArgs[0],
options: CtxMenuConstructorArgs[1]
) {
options = options || {}
if (options.scroll_speed) {
options.scroll_speed *= -1
} else {
options.scroll_speed = -0.1
}
super(values, options)
// @ts-expect-error
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 = InvertContextMenu
LiteGraph.ContextMenu.prototype = ctxMenu.prototype
}
app.ui.settings.addSetting({
id,