From 7ec31ac40fe0cc2d1d94586f6ab6494f05c8c412 Mon Sep 17 00:00:00 2001 From: gasparschott Date: Sat, 23 Mar 2024 11:02:08 -0700 Subject: [PATCH] Bug fixes --- main.js | 10 +++++----- manifest.json | 2 +- styles.css | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index da6ddef..8c242f3 100644 --- a/main.js +++ b/main.js @@ -122,7 +122,6 @@ class ContinuousModePlugin extends obsidian.Plugin { if ( getActiveLeaf().containerEl.closest('.workspace-split.mod-root') === null && !getActiveEditor()?.hasFocus() ) { return; } // return if not in leaf editor or editor not focussed let cursorAnchor = getActiveEditor()?.getCursor('anchor'); let activeTabGroupChildren = getActiveLeaf().workspace.activeTabGroup.children; -console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItems); switch(e.key) { case 'ArrowUp': case 'ArrowLeft': switch(true) { @@ -250,7 +249,7 @@ console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItem item2.setTitle('Toggle Continuous Mode') .setChecked( getTabGroupById(tab_group_id).containerEl.classList.contains('is_continuous_mode') ? true : false ) .onClick(async () => { - toggleContinuousMode(tab_group_id); + toggleContinuousMode(tab_group_id || this.app.appId+'_'+getActiveTabGroup().id); }) }) .addItem((item3) => { @@ -311,9 +310,10 @@ console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItem ); this.registerEvent( // initContinuousMode on layout change this.app.workspace.on('layout-change', async () => { -// updateTabGroupDatasetIds(); -// cleanDataTabGroupIds(); // disabled -// initContinuousMode(); + updateTabGroupDatasetIds(); + cleanDataTabGroupIds(); // disabled + initContinuousMode(); + scrollActiveLeafIntoView(); }) ); this.app.workspace.onLayoutReady( async () => { // initContinuousMode on layout ready diff --git a/manifest.json b/manifest.json index 0417f24..76f095d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "continuous-mode", "name": "Continuous Mode", - "version": "1.2.1", + "version": "1.2.2", "minAppVersion": "0.15.0", "description": "Displays all open notes in a tab group as if they were a continuous scrollable document (sometimes called \"Scrivenings mode\"). Features include arrow navigation between notes and the ability to reorder notes via tab header drag-and-drop.", "author": "Michael Schrauzer", diff --git a/styles.css b/styles.css index 23e8690..f7797cc 100644 --- a/styles.css +++ b/styles.css @@ -71,7 +71,7 @@ .workspace-tabs.is_continuous_mode:not(.mod-stacked) .markdown-preview-view img:not([width]), .markdown-rendered img:not([width]) { - max-width:calc(100% - 2*var(--file-margins)); +/* max-width:calc(100% - 2*var(--file-margins)); */ } /* pdf note styles */ .workspace-tabs.is_continuous_mode:not(.mod-stacked) .workspace-leaf-content[data-type="pdf"] .view-content