Skip to content

Commit

Permalink
Feat: Use default hover functionality for nodes
Browse files Browse the repository at this point in the history
This provides compatibility with the hover editor plugin
  • Loading branch information
HEmile committed Mar 12, 2022
1 parent 329c879 commit 7a6e135
Show file tree
Hide file tree
Showing 5 changed files with 79,720 additions and 9 deletions.
79,655 changes: 79,651 additions & 4 deletions main.js

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/viz/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
EventRef,
Events,
MarkdownRenderer,
Menu,
Menu, TFile,
Vault,
Workspace,
} from 'obsidian';
Expand Down Expand Up @@ -206,10 +206,10 @@ export class Juggl extends Component implements IJuggl {
if (id.storeId === 'core') {
const file = this.plugin.metadata.getFirstLinkpathDest(id.id, '');
if (file && file.extension === 'md' && (e.originalEvent.metaKey || !this.settings.metaKeyHover)) {
const content = await view.vault.cachedRead(file);
// const content = await view.vault.cachedRead(file);
this.hoverTimeout[e.target.id()] = setTimeout(async () =>
await this.popover(content, file.path, e.target, 'advanced-graph-preview-node'),
400);
this.plugin.app.workspace.trigger('link-hover', this.element, null, file.path, ''),
300 );
}
}
});
Expand Down
3 changes: 2 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ div.juggl-error {
height: 100%;
}

.juggl-hover {
.juggl-hover.is-loaded.hover-popover.popover {
opacity: 0.9;
height: max-content;
}

.juggl-preview-edge {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "ESNext",
"target": "es2020",
"sourceMap": true,
"moduleResolution": "node",
"noImplicitAny": true,
"importHelpers": true,
"lib": [
Expand Down

0 comments on commit 7a6e135

Please sign in to comment.