Skip to content

Commit

Permalink
Merge branch 'master' into refact/handle-robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Quorafind committed Jan 18, 2024
2 parents 783bdf5 + 35d3190 commit 6619b48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
- Press `Enter` to create brother card;
- Press `Tab` to create child card;
- Delete card to rearrange layout automatically;
- Press `Alt` + `←/→/↓/↑` to navigate between cards;
- Press `Cmd / Ctrl` + `←/→/↓/↑` to create floating cards;

## Showcase

![showcase](https://raw.githubusercontent.com/Quorafind/obsidian-canvas-mindmap/master/showcase.gif)

# How to Install

## From Plugin Market in Obsidian [Not Yet]
## From Plugin Market in Obsidian

💜: Directly install from Obsidian Market.

Expand Down
10 changes: 2 additions & 8 deletions src/canvasMindMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,14 @@ export default class CanvasMindMap extends Plugin {


const patchCanvas = () => {

const canvasView = this.app.workspace.getLeavesOfType("canvas").first()?.view;
// @ts-ignore
const canvas = canvasView?.canvas;
console.log(canvas);
if (!canvasView) return false;

const patchCanvasView = canvas.constructor;

console.log("patchCanvasView", patchCanvasView);

const canvasViewunistaller = around(canvasView.constructor.prototype, {
onOpen: (next) =>
async function () {
Expand Down Expand Up @@ -364,22 +362,18 @@ export default class CanvasMindMap extends Plugin {
setTimeout(() => {
const realNode = this.canvas.nodes?.get(node.id);
realNode?.startEditing();

this.canvas.zoomToSelection();
}, 0);
});

this.scope.register([], "Tab", async () => {


const node = await createChildNode(this.canvas);
console.log(this, node);
if (!node) return;

setTimeout(() => {
const realNode = this.canvas.nodes?.get(node.id);
realNode?.startEditing();

this.canvas.zoomToSelection();
}, 0);
});
Expand Down

0 comments on commit 6619b48

Please sign in to comment.