From 4bd34db31216e21679901f669c39c2eec7348b82 Mon Sep 17 00:00:00 2001 From: PathGao <42336971+PathGao@users.noreply.github.com> Date: Fri, 13 Nov 2026 13:59:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E5=92=8C=E4=B8=A4=E4=B8=AA=E5=BC=B9=E7=AA=97=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E5=8E=9F=E7=94=9F=20field-sizing=20=E4=B8=8E=20closed?= =?UTF-8?q?by?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extension/download.js | 11 ++--------- extension/history/history.html | 2 +- extension/sidepanel.css | 2 ++ extension/sidepanel.js | 20 +------------------- extension/triage/tag-picker.js | 6 ------ extension/triage/triage.html | 2 +- 6 files changed, 7 insertions(+), 36 deletions(-) diff --git a/extension/download.js b/extension/download.js index cbba6494..319c3a79 100644 --- a/extension/download.js +++ b/extension/download.js @@ -120,15 +120,8 @@ dialog.className = "mdg-overwrite"; dialog.innerHTML = html; fill(dialog); - // A click outside is a press and a release both on the backdrop: a text selection dragged out of the box ends - // with a click on the dialog too, and must not close it. - let downOutside = false; - dialog.addEventListener("pointerdown", (event) => (downOutside = event.target === dialog)); - dialog.addEventListener("click", (event) => { - if (downOutside && event.target === dialog) { - dialog.close(""); - } - }); + // A click outside closes it (returnValue stays "", 取消); a text selection dragged out of the box does not. + dialog.closedBy = "any"; document.body.appendChild(dialog); dialog.showModal(); return new Promise((resolve) => { diff --git a/extension/history/history.html b/extension/history/history.html index 65278f4d..3ac5cece 100644 --- a/extension/history/history.html +++ b/extension/history/history.html @@ -31,7 +31,7 @@