Skip to content

Commit

Permalink
More fixes for Super Focus Mode when many panels and splits exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan McQuen authored and Ryan McQuen committed Nov 1, 2022
1 parent 1b7a2d4 commit be355a0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
14 changes: 14 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ export default class FocusMode extends Plugin {
this.app.workspace.activeLeaf.view.editor.focus();
// @ts-ignore
this.app.workspace.activeLeaf.view.editor.refresh();

Array.from(
document.querySelectorAll(
`.${this.superFocusModeClass} .workspace-split`
)
).forEach((node) => {
const theNode = node as HTMLElement;
const hasActiveKids = theNode.querySelector(".mod-active");
if (hasActiveKids) {
theNode.style.display = "flex";
} else {
theNode.style.display = "none";
}
});
} catch (ignore) {}
});

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-focus-mode",
"name": "Focus Mode",
"version": "1.11.1",
"version": "1.11.2",
"minAppVersion": "0.9.12",
"description": "Add Focus Mode to Obsidian.",
"author": "ryanpcmcquen",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-focus-mode",
"version": "1.11.1",
"version": "1.11.2",
"description": "Add Focus Mode to Obsidian.",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
.focus-mode .status-bar,
.focus-mode .view-actions,
.focus-mode .view-header-icon,
.focus-mode .view-header-title,
.focus-mode .inline-title,
.focus-mode .workspace-ribbon:not(.mod-left),
.focus-mode .workspace-split.maximised .workspace-leaf:not(.mod-active),
.focus-mode
.workspace-split.maximised
.workspace-leaf.mod-active
~ .workspace-split,
.focus-mode.plugin-tabs .stayopen .view-header,
.super-focus-mode .workspace-tabs:not(.mod-active),
.super-focus-mode .workspace-split .workspace-split .workspace-split {
.super-focus-mode .workspace-tabs:not(.mod-active) {
display: none;
}

Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"1.11.2": "0.10.9",
"1.11.1": "0.10.9",
"1.11.0": "0.10.9",
"1.10.2": "0.10.9",
Expand Down

0 comments on commit be355a0

Please sign in to comment.