saving options for left pane sizing

This commit is contained in:
azivner
2018-09-06 11:17:30 +02:00
parent bdc2fa1019
commit ff086569f2
5 changed files with 41 additions and 2 deletions

View File

@@ -48,6 +48,8 @@ export default {
addTabHandler((function() {
const $themeSelect = $("#theme-select");
const $zoomFactorSelect = $("#zoom-factor-select");
const $leftPaneMinWidth = $("#left-pane-min-width");
const $leftPaneWidthPercent = $("#left-pane-width-percent");
const $html = $("html");
function optionsLoaded(options) {
@@ -59,6 +61,9 @@ addTabHandler((function() {
else {
$zoomFactorSelect.prop('disabled', true);
}
$leftPaneMinWidth.val(options.leftPaneMinWidth);
$leftPaneWidthPercent.val(options.leftPaneWidthPercent);
}
$themeSelect.change(function() {
@@ -75,6 +80,18 @@ addTabHandler((function() {
zoomService.setZoomFactorAndSave(newZoomFactor);
});
$leftPaneMinWidth.change(function() {
const newMinWidth = $(this).val();
server.put('options/leftPaneMinWidth/' + newMinWidth);
});
$leftPaneWidthPercent.change(function() {
const newWidthPercent = $(this).val();
server.put('options/leftPaneWidthPercent/' + newWidthPercent);
});
return {
optionsLoaded
};