mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 10:15:52 +01:00
refactoring of access to options in frontend
This commit is contained in:
@@ -45,7 +45,7 @@ export default class ApperanceOptions {
|
||||
const hideTabRowForOneTab = this.$oneTabDisplaySelect.val() === 'hide' ? 'true' : 'false';
|
||||
|
||||
server.put('options/hideTabRowForOneTab/' + hideTabRowForOneTab)
|
||||
.then(optionsInit.loadOptions);
|
||||
.then(optionsInit.reloadOptions);
|
||||
});
|
||||
|
||||
this.$leftPaneMinWidth.change(async () => {
|
||||
|
||||
@@ -18,7 +18,7 @@ export default class ProtectedSessionOptions {
|
||||
const protectedSessionTimeout = this.$protectedSessionTimeout.val();
|
||||
|
||||
server.put('options', { 'protectedSessionTimeout': protectedSessionTimeout }).then(() => {
|
||||
optionsInit.loadOptions();
|
||||
optionsInit.reloadOptions();
|
||||
|
||||
infoService.showMessage("Options change have been saved.");
|
||||
});
|
||||
|
||||
@@ -24,11 +24,11 @@ export default class SidebarOptions {
|
||||
});
|
||||
|
||||
this.$showSidebarInNewTab.change(async () => {
|
||||
const flag = this.$showSidebarInNewTab.is(":checked") ? 1 : 0;
|
||||
const flag = this.$showSidebarInNewTab.is(":checked") ? 'true' : 'false';
|
||||
|
||||
await server.put('options/showSidebarInNewTab/' + flag);
|
||||
|
||||
optionsInit.loadOptions();
|
||||
optionsInit.reloadOptions();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -116,6 +116,8 @@ export default class SidebarOptions {
|
||||
});
|
||||
|
||||
await server.put('options', opts);
|
||||
|
||||
optionsInit.reloadOptions();
|
||||
}
|
||||
|
||||
parseJsonSafely(str) {
|
||||
|
||||
Reference in New Issue
Block a user