refactoring of access to options in frontend

This commit is contained in:
zadam
2019-08-22 23:31:02 +02:00
parent b84542064c
commit f9abea83f3
13 changed files with 93 additions and 62 deletions

View File

@@ -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 () => {

View File

@@ -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.");
});

View File

@@ -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) {