Skip to content

Commit be355a0

Browse files
committed
More fixes for Super Focus Mode when many panels and splits exist.
1 parent 1b7a2d4 commit be355a0

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

main.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ export default class FocusMode extends Plugin {
8181
this.app.workspace.activeLeaf.view.editor.focus();
8282
// @ts-ignore
8383
this.app.workspace.activeLeaf.view.editor.refresh();
84+
85+
Array.from(
86+
document.querySelectorAll(
87+
`.${this.superFocusModeClass} .workspace-split`
88+
)
89+
).forEach((node) => {
90+
const theNode = node as HTMLElement;
91+
const hasActiveKids = theNode.querySelector(".mod-active");
92+
if (hasActiveKids) {
93+
theNode.style.display = "flex";
94+
} else {
95+
theNode.style.display = "none";
96+
}
97+
});
8498
} catch (ignore) {}
8599
});
86100

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-focus-mode",
33
"name": "Focus Mode",
4-
"version": "1.11.1",
4+
"version": "1.11.2",
55
"minAppVersion": "0.9.12",
66
"description": "Add Focus Mode to Obsidian.",
77
"author": "ryanpcmcquen",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-focus-mode",
3-
"version": "1.11.1",
3+
"version": "1.11.2",
44
"description": "Add Focus Mode to Obsidian.",
55
"main": "main.js",
66
"scripts": {

styles.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
.focus-mode .status-bar,
88
.focus-mode .view-actions,
99
.focus-mode .view-header-icon,
10-
.focus-mode .view-header-title,
10+
.focus-mode .inline-title,
1111
.focus-mode .workspace-ribbon:not(.mod-left),
1212
.focus-mode .workspace-split.maximised .workspace-leaf:not(.mod-active),
1313
.focus-mode
1414
.workspace-split.maximised
1515
.workspace-leaf.mod-active
1616
~ .workspace-split,
1717
.focus-mode.plugin-tabs .stayopen .view-header,
18-
.super-focus-mode .workspace-tabs:not(.mod-active),
19-
.super-focus-mode .workspace-split .workspace-split .workspace-split {
18+
.super-focus-mode .workspace-tabs:not(.mod-active) {
2019
display: none;
2120
}
2221

versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.11.2": "0.10.9",
23
"1.11.1": "0.10.9",
34
"1.11.0": "0.10.9",
45
"1.10.2": "0.10.9",

0 commit comments

Comments
 (0)