From 752dbc0c3c7dc10ee2eb5d7a913f61251ad05b2f Mon Sep 17 00:00:00 2001 From: Philemon Chiro <49866367+PhilemonChiro@users.noreply.github.com> Date: Sat, 2 May 2026 08:32:30 +0200 Subject: [PATCH] Fix two pre-bot lints: discard tooltip sentence case, activeDocument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 'Discard (Esc)' → 'Discard (esc)' for the obsidianmd sentence-case rule - document.activeElement → activeDocument.activeElement in the capture's blur handler (popout-window compatibility) --- main.js | 5 +++-- main.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 6cf867e..df60d0b 100644 --- a/main.js +++ b/main.js @@ -577,7 +577,7 @@ var CardsView = class extends obsidian.ItemView { const discardBtn = actions.createEl("button", { cls: "keep-cards-capture-discard", text: "Discard", - attr: { type: "button", title: "Discard (Esc)" } + attr: { type: "button", title: "Discard (esc)" } }); discardBtn.addEventListener("mousedown", (e) => e.preventDefault()); discardBtn.addEventListener("click", () => { @@ -623,7 +623,8 @@ var CardsView = class extends obsidian.ItemView { if (blurTimer) window.clearTimeout(blurTimer); blurTimer = window.setTimeout(() => { blurTimer = null; - if (document.activeElement && wrap.contains(document.activeElement)) return; + const doc = activeDocument; + if (doc.activeElement && wrap.contains(doc.activeElement)) return; submit(); }, 200); }); diff --git a/main.ts b/main.ts index a83bce7..a5e003b 100644 --- a/main.ts +++ b/main.ts @@ -696,7 +696,7 @@ class CardsView extends obsidian.ItemView { const discardBtn = actions.createEl('button', { cls: 'keep-cards-capture-discard', text: 'Discard', - attr: { type: 'button', title: 'Discard (Esc)' }, + attr: { type: 'button', title: 'Discard (esc)' }, }); discardBtn.addEventListener('mousedown', (e) => e.preventDefault()); discardBtn.addEventListener('click', () => { @@ -750,7 +750,8 @@ class CardsView extends obsidian.ItemView { if (blurTimer) window.clearTimeout(blurTimer); blurTimer = window.setTimeout(() => { blurTimer = null; - if (document.activeElement && wrap.contains(document.activeElement)) return; + const doc = activeDocument; + if (doc.activeElement && wrap.contains(doc.activeElement)) return; submit(); }, 200); });