mirror of
https://github.com/ytliu74/obsidian-pseudocode.git
synced 2026-07-22 07:40:25 +00:00
fix: fix click button will also enter edit
This commit is contained in:
parent
6614713042
commit
100c1c5bad
1 changed files with 7 additions and 5 deletions
12
main.ts
12
main.ts
|
|
@ -31,11 +31,13 @@ export default class PseudocodePlugin extends Plugin {
|
|||
const blockWidth = this.settings.blockSize;
|
||||
blockDiv.style.width = `${blockWidth}em`;
|
||||
blockDiv.addEventListener("click", (event) => {
|
||||
((event.target as HTMLElement)
|
||||
.closest('.pseudocode-block')!
|
||||
.parentElement!.parentElement!
|
||||
.querySelector('.edit-block-button') as HTMLElement)!
|
||||
.click();
|
||||
const target = (event.target as HTMLElement)!;
|
||||
if(target.tagName !== 'BUTTON')
|
||||
(target
|
||||
.closest('.pseudocode-block')!
|
||||
.parentElement!.parentElement!
|
||||
.querySelector('.edit-block-button') as HTMLElement)!
|
||||
.click();
|
||||
});
|
||||
|
||||
// Extract inline macros
|
||||
|
|
|
|||
Loading…
Reference in a new issue