Skip to content

Commit

Permalink
feat: Clicking the excalidraw tag does not open the card view
Browse files Browse the repository at this point in the history
  • Loading branch information
seyeeL committed Aug 16, 2024
1 parent 51655da commit c7a224f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default class CardsViewPlugin extends Plugin {
}),
);

const excalidraw = (this.app as any).plugins.plugins[
"obsidian-excalidraw-plugin"
];

// 添加标签点击事件监听器
this.registerDomEvent(document, "click", (evt: MouseEvent) => {
if (this.settings.openCardsViewOnTagClick) {
Expand All @@ -73,6 +77,9 @@ export default class CardsViewPlugin extends Plugin {
if (textElement) {
const tagName = textElement.textContent?.trim();
console.log("tagName", tagName);
if (excalidraw && tagName === "excalidraw") {
return;
}
if (tagName) {
this.openTagInCardsView(tagName);
evt.preventDefault();
Expand Down

0 comments on commit c7a224f

Please sign in to comment.