From afa619b7dff200e2227751c933105966bd758bf7 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 24 Oct 2024 02:37:40 +0200 Subject: [PATCH] Revert "Enable ts-strict for invertMenuScrolling.ts (#1264)" (#1288) This reverts commit 9388ee070571c6ccbf022fd1fea3963a1a707eb1. --- src/extensions/core/invertMenuScrolling.ts | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/extensions/core/invertMenuScrolling.ts b/src/extensions/core/invertMenuScrolling.ts index 6766496b9..63806c37f 100644 --- a/src/extensions/core/invertMenuScrolling.ts +++ b/src/extensions/core/invertMenuScrolling.ts @@ -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 - 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,