From 095eee30d951c35898a588476c217d44942b2cda Mon Sep 17 00:00:00 2001 From: strawberrymelonpanda <152940198+strawberrymelonpanda@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:31:38 -0700 Subject: [PATCH] Fix checkpoint loader v2 closing search on mouseup --- .../power_model_loader_v2.js | 25 +++---------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/web/power_lora_loader_js/power_model_loader_v2.js b/web/power_lora_loader_js/power_model_loader_v2.js index d76233e..a58468b 100644 --- a/web/power_lora_loader_js/power_model_loader_v2.js +++ b/web/power_lora_loader_js/power_model_loader_v2.js @@ -1,6 +1,6 @@ import { app } from "../../../scripts/app.js"; import { rgthree } from "../rgthree/common/rgthree.js"; -import { RgthreeBetterButtonWidget, RgthreeDividerWidget } from "./widgets.js"; +import { RgthreeBetterButtonWidget, RgthreeDividerWidget, RgthreeBaseWidget } from "./widgets.js"; import { drawRoundedRectangle, drawTogglePart, drawWidgetButton, fitString, isLowQuality } from "./widgets.js"; import { LoraPickerDialog } from "./lora_picker_dialog.js"; import { WanLoraInfoDialog } from "./dialog_info.js"; @@ -52,17 +52,14 @@ function loadEyeRefreshState() { // Custom widget for model selection -class PowerModelLoaderWidget { +class PowerModelLoaderWidget extends RgthreeBaseWidget { constructor(name, showModelChooser) { - this.name = name; - this.type = "custom"; + super(name); this.showModelChooser = showModelChooser; this.value = { on: true, model: "None" }; this.options = {}; this.y = 0; this.last_y = 0; - this.mouseDowned = null; - this.isMouseDownedAndOver = false; this.hitAreas = { model: { bounds: [0, 0], onClick: this.onModelClick }, }; @@ -114,20 +111,6 @@ class PowerModelLoaderWidget { } } - mouse(event, pos, node) { - if (event.type === "pointerdown") { - // Check if click is within model area - if (this.clickWasWithinBounds(pos, this.hitAreas.model.bounds)) { - // Only handle left-clicks for model selection - if (event.button === 0 || event.button === 1) { - this.onModelClick(event, pos, node); - return true; - } - } - } - return false; - } - clickWasWithinBounds(pos, bounds) { if (!bounds) return false; return pos[0] >= bounds[0] && pos[0] <= bounds[0] + bounds[2] && @@ -522,4 +505,4 @@ app.registerExtension({ }; } }, -}); \ No newline at end of file +});