mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 09:28:45 +02:00
fix zen mode
This commit is contained in:
parent
03e0c98066
commit
687539cc95
@ -82,7 +82,6 @@ export default class ApperanceOptions {
|
||||
this.$treeFontSize = $("#tree-font-size");
|
||||
this.$detailFontSize = $("#detail-font-size");
|
||||
this.$body = $("body");
|
||||
this.$container = $("#container");
|
||||
|
||||
this.$themeSelect.on('change', () => {
|
||||
const newTheme = this.$themeSelect.val();
|
||||
|
@ -114,13 +114,13 @@ export default class Entrypoints extends Component {
|
||||
toggleZenModeCommand() {
|
||||
if (!this.zenModeActive) {
|
||||
$(".hide-in-zen-mode,.gutter").addClass("hidden-by-zen-mode");
|
||||
$("#container").addClass("zen-mode");
|
||||
$("#root-widget").addClass("zen-mode");
|
||||
this.zenModeActive = true;
|
||||
}
|
||||
else {
|
||||
// not hiding / showing explicitly since element might be hidden also for other reasons
|
||||
$(".hide-in-zen-mode,.gutter").removeClass("hidden-by-zen-mode");
|
||||
$("#container").removeClass("zen-mode");
|
||||
$("#root-widget").removeClass("zen-mode");
|
||||
this.zenModeActive = false;
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ async function setupProtectedSession(password) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("#container").addClass('protected-session-active');
|
||||
|
||||
protectedSessionHolder.setProtectedSessionId(response.protectedSessionId);
|
||||
protectedSessionHolder.touchProtectedSession();
|
||||
|
||||
|
@ -31,6 +31,11 @@ class BasicWidget extends Component {
|
||||
return this;
|
||||
}
|
||||
|
||||
hideInZenMode() {
|
||||
this.class('hide-in-zen-mode');
|
||||
return this;
|
||||
}
|
||||
|
||||
cssBlock(block) {
|
||||
this.cssEl = block;
|
||||
return this;
|
||||
|
@ -105,9 +105,12 @@ export default class DesktopLayout {
|
||||
.child(new GlobalMenuWidget())
|
||||
.child(new TabRowWidget())
|
||||
.child(new TitleBarButtonsWidget()))
|
||||
.child(new StandardTopWidget())
|
||||
.child(new FlexContainer('row').collapsible()
|
||||
.child(new StandardTopWidget()
|
||||
.hideInZenMode())
|
||||
.child(new FlexContainer('row')
|
||||
.collapsible()
|
||||
.child(new SidePaneContainer('left')
|
||||
.hideInZenMode()
|
||||
.child(new GlobalButtonsWidget())
|
||||
.child(new SearchBoxWidget())
|
||||
.child(new SearchResultsWidget())
|
||||
@ -116,17 +119,19 @@ export default class DesktopLayout {
|
||||
.child(new FlexContainer('column').id('center-pane')
|
||||
.child(new FlexContainer('row').class('title-row')
|
||||
.cssBlock('.title-row > * { margin: 5px; }')
|
||||
.child(new TabCachingWidget(() => new NotePathsWidget()))
|
||||
.child(new TabCachingWidget(() => new NotePathsWidget()).hideInZenMode())
|
||||
.child(new NoteTitleWidget())
|
||||
.child(new RunScriptButtonsWidget())
|
||||
.child(new ProtectedNoteSwitchWidget())
|
||||
.child(new NoteTypeWidget())
|
||||
.child(new NoteActionsWidget())
|
||||
.child(new RunScriptButtonsWidget().hideInZenMode())
|
||||
.child(new ProtectedNoteSwitchWidget().hideInZenMode())
|
||||
.child(new NoteTypeWidget().hideInZenMode())
|
||||
.child(new NoteActionsWidget().hideInZenMode())
|
||||
)
|
||||
.child(new TabCachingWidget(() => new PromotedAttributesWidget()))
|
||||
.child(new TabCachingWidget(() => new NoteDetailWidget()))
|
||||
)
|
||||
.child(new SidePaneContainer('right').cssBlock(RIGHT_PANE_CSS)
|
||||
.child(new SidePaneContainer('right')
|
||||
.cssBlock(RIGHT_PANE_CSS)
|
||||
.hideInZenMode()
|
||||
.child(new NoteInfoWidget())
|
||||
.child(new TabCachingWidget(() => new CalendarWidget()))
|
||||
.child(new TabCachingWidget(() => new AttributesWidget()))
|
||||
@ -135,7 +140,7 @@ export default class DesktopLayout {
|
||||
.child(new TabCachingWidget(() => new SimilarNotesWidget()))
|
||||
.child(new TabCachingWidget(() => new WhatLinksHereWidget()))
|
||||
)
|
||||
.child(new SidePaneToggles())
|
||||
.child(new SidePaneToggles().hideInZenMode())
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user