mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
option to configure if sidebar should be enabled in new tab
This commit is contained in:
@@ -17,6 +17,7 @@ import noteDetailRender from "./note_detail_render.js";
|
||||
import noteDetailRelationMap from "./note_detail_relation_map.js";
|
||||
import noteDetailProtectedSession from "./note_detail_protected_session.js";
|
||||
import protectedSessionService from "./protected_session.js";
|
||||
import optionsInitService from "./options_init.js";
|
||||
import linkService from "./link.js";
|
||||
import Sidebar from "./sidebar.js";
|
||||
|
||||
@@ -34,6 +35,12 @@ const componentClasses = {
|
||||
'protected-session': noteDetailProtectedSession
|
||||
};
|
||||
|
||||
let showSidebarInNewTab = true;
|
||||
|
||||
optionsInitService.addLoadListener(options => {
|
||||
showSidebarInNewTab = options.showSidebarInNewTab === '1';
|
||||
});
|
||||
|
||||
class TabContext {
|
||||
/**
|
||||
* @param {TabRow} tabRow
|
||||
@@ -64,7 +71,11 @@ class TabContext {
|
||||
this.attributes = new Attributes(this);
|
||||
|
||||
if (utils.isDesktop()) {
|
||||
this.sidebar = new Sidebar(this, state.sidebar);
|
||||
const sidebarState = state.sidebar || {
|
||||
visible: showSidebarInNewTab
|
||||
};
|
||||
|
||||
this.sidebar = new Sidebar(this, sidebarState);
|
||||
this.noteType = new NoteTypeContext(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user