mirror of
https://github.com/philemonchiro/obsidian-notekeeper.git
synced 2026-07-22 06:51:40 +00:00
Fix two pre-bot lints: discard tooltip sentence case, activeDocument
- 'Discard (Esc)' → 'Discard (esc)' for the obsidianmd sentence-case rule - document.activeElement → activeDocument.activeElement in the capture's blur handler (popout-window compatibility)
This commit is contained in:
parent
5659633ad8
commit
752dbc0c3c
2 changed files with 6 additions and 4 deletions
5
main.js
5
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);
|
||||
});
|
||||
|
|
|
|||
5
main.ts
5
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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue