From dd336b57163b226fd31f5cba3b83c7f7aa50d729 Mon Sep 17 00:00:00 2001 From: Shukai Ni Date: Fri, 14 Oct 2022 10:20:47 -0400 Subject: [PATCH] Fix MarkdownSubView API change --- main.ts | 6 ++---- manifest.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/main.ts b/main.ts index 0a395be..1133efb 100644 --- a/main.ts +++ b/main.ts @@ -1,6 +1,6 @@ import { Plugin, Notice, MarkdownView } from "obsidian"; type Coordinates = { x: number; y: number; getScroll: () => number }; -type MarkdownSubView = { contentContainerEl: HTMLElement }; +type MarkdownSubView = { sizerEl: HTMLElement }; export default class NinjaCursorPlugin extends Plugin { lastPos: Coordinates = { x: 0, y: 0, getScroll: () => 0 }; @@ -13,8 +13,7 @@ export default class NinjaCursorPlugin extends Plugin { this.app?.workspace.getActiveViewOfType(MarkdownView) ?.currentMode )) - ))?.contentContainerEl?.parentElement; - + ))?.sizerEl?.parentElement; const selection = activeWindow.getSelection(); if (!parentElement || !selection || !selection.focusNode) { return; @@ -31,7 +30,6 @@ export default class NinjaCursorPlugin extends Plugin { } const cursorDOMRects = cursorRange.getClientRects(); - //console.log(cursorDOMRects) const cursorDomRect = cursorDOMRects.item(cursorDOMRects.length - 1); if (!cursorDomRect) { diff --git a/manifest.json b/manifest.json index d0f4ef9..469a6fb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "id": "obsidian-dashing-cursor", "name": "Dashing cursor", - "version": "0.0.1", - "minAppVersion": "0.15.0", + "version": "0.0.2", + "minAppVersion": "1.0.0", "description": "Enables dashing cursor that follows the page scroll", "author": "Shukai Ni", "authorUrl": "https://github.com/9r0x/obsidian-dashing-cursor", diff --git a/package.json b/package.json index ad196e6..5bd4cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-dashing-cursor", - "version": "0.0.1", + "version": "0.0.2", "description": "Enables dashing cursor that follows the page scroll", "main": "main.js", "scripts": {