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:
@@ -354,10 +354,18 @@ addTabHandler((async function () {
|
||||
addTabHandler((function() {
|
||||
const $sidebarMinWidth = $("#sidebar-min-width");
|
||||
const $sidebarWidthPercent = $("#sidebar-width-percent");
|
||||
const $showSidebarInNewTab = $("#show-sidebar-in-new-tab");
|
||||
|
||||
async function optionsLoaded(options) {
|
||||
$sidebarMinWidth.val(options.sidebarMinWidth);
|
||||
$sidebarWidthPercent.val(options.sidebarWidthPercent);
|
||||
|
||||
if (parseInt(options.showSidebarInNewTab)) {
|
||||
$showSidebarInNewTab.attr("checked", "checked");
|
||||
}
|
||||
else {
|
||||
$showSidebarInNewTab.removeAttr("checked");
|
||||
}
|
||||
}
|
||||
|
||||
function resizeSidebar() {
|
||||
@@ -385,6 +393,14 @@ addTabHandler((function() {
|
||||
resizeSidebar();
|
||||
});
|
||||
|
||||
$showSidebarInNewTab.change(async function() {
|
||||
const flag = $(this).is(":checked") ? 1 : 0;
|
||||
|
||||
await server.put('options/showSidebarInNewTab/' + flag);
|
||||
|
||||
optionsInit.loadOptions();
|
||||
});
|
||||
|
||||
return {
|
||||
optionsLoaded
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user