Skip to content

Commit

Permalink
Merge pull request #4 from Quorafind/dev
Browse files Browse the repository at this point in the history
Fix not working in 0.14.x
  • Loading branch information
Quorafind authored Jul 12, 2022
2 parents f6d836d + 96105c7 commit da99835
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-table-generator",
"name": "Table Generator",
"version": "1.1.0",
"version": "1.1.1",
"minAppVersion": "0.12.0",
"description": "A plugin for generate markdown table quickly like Typora.",
"author": "Quorafind",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "obsidian-table-generator",
"version": "1.1.0",
"version": "1.1.1",
"description": "A plugin for generate markdown table quickly like Typora.",
"main": "main.js",
"scripts": {
"lint": "eslint . --ext .ts",
"dev": "npm run lint && vite build --watch ",
"dev": "npm run lint && vite build --watch --mode=development",
"build": "npx svelte-check && vite build --mode=production",
"bumpversion": "node version-bump.mjs && git add manifest.json versions.json"
},
Expand Down
15 changes: 8 additions & 7 deletions src/tableGeneratorIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ export default class TableGeneratorPlugin extends Plugin {
}
});

this.registerDomEvent(window, 'click', (evt: MouseEvent) => {
if ((evt.targetNode as HTMLElement)?.classList.contains("table-generator-menu") || (evt.targetNode as HTMLElement)?.parentElement?.classList.contains("table-generator-menu")) return;
if ((evt.targetNode as HTMLElement) === null) hideTable(true);
if (!this.tableGeneratorEl?.contains(evt.targetNode as HTMLElement))
hideTable();
}
);

if (requireApiVersion("0.15.0")) {
this.registerDomEvent(window, 'click', (evt: MouseEvent) => {
if ((evt.targetNode as HTMLElement)?.classList.contains("table-generator-menu") || (evt.targetNode as HTMLElement)?.parentElement?.classList.contains("table-generator-menu")) return;
if ((evt.targetNode as HTMLElement) === null) hideTable(true);
if (!this.tableGeneratorEl?.contains(evt.targetNode as HTMLElement))
hideTable();
}
);

this.app.workspace.on('window-open', (leaf) => {
this.registerDomEvent(leaf.doc, 'click', (evt: MouseEvent) => {
if ((evt.target as HTMLElement).classList.contains("table-generator-menu") || (evt.target as HTMLElement).parentElement?.classList.contains("table-generator-menu")) return;
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"1.0.0": "0.9.7",
"1.0.1": "0.12.0",
"1.0.3": "0.12.0",
"1.1.0": "0.12.0"
"1.1.0": "0.12.0",
"1.1.1": "0.12.0"
}
3 changes: 3 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default defineConfig(({mode}) => {
if (mode === 'production') {
prod = true;
}
if (mode === 'development') {
prod = false;
}
return {
plugins: [
svelte({
Expand Down

0 comments on commit da99835

Please sign in to comment.