removed hideTabRowForOneTab option

This commit is contained in:
zadam 2019-12-23 19:39:48 +01:00
parent bcf163f8a1
commit 6986c201dd
4 changed files with 3 additions and 32 deletions

View File

@ -9,24 +9,16 @@ const TPL = `
<form> <form>
<div class="form-group row"> <div class="form-group row">
<div class="col-4"> <div class="col-6">
<label for="theme-select">Theme</label> <label for="theme-select">Theme</label>
<select class="form-control" id="theme-select"></select> <select class="form-control" id="theme-select"></select>
</div> </div>
<div class="col-4"> <div class="col-6">
<label for="zoom-factor-select">Zoom factor (desktop build only)</label> <label for="zoom-factor-select">Zoom factor (desktop build only)</label>
<input type="number" class="form-control" id="zoom-factor-select" min="0.3" max="2.0" step="0.1"/> <input type="number" class="form-control" id="zoom-factor-select" min="0.3" max="2.0" step="0.1"/>
</div> </div>
<div class="col-4">
<label for="one-tab-display-select">If there's only one tab, then...</label>
<select class="form-control" id="one-tab-display-select">
<option value="show">show the tab bar</option>
<option value="hide">hide the tab bar</option>
</select>
</div>
</div> </div>
<p>Zooming can be controlled with CTRL-+ and CTRL-= shortcuts as well.</p> <p>Zooming can be controlled with CTRL-+ and CTRL-= shortcuts as well.</p>
@ -108,7 +100,6 @@ export default class ApperanceOptions {
this.$themeSelect = $("#theme-select"); this.$themeSelect = $("#theme-select");
this.$zoomFactorSelect = $("#zoom-factor-select"); this.$zoomFactorSelect = $("#zoom-factor-select");
this.$oneTabDisplaySelect = $("#one-tab-display-select");
this.$leftPaneMinWidth = $("#left-pane-min-width"); this.$leftPaneMinWidth = $("#left-pane-min-width");
this.$leftPaneWidthPercent = $("#left-pane-width-percent"); this.$leftPaneWidthPercent = $("#left-pane-width-percent");
this.$mainFontSize = $("#main-font-size"); this.$mainFontSize = $("#main-font-size");
@ -141,13 +132,6 @@ export default class ApperanceOptions {
this.$zoomFactorSelect.on('change', () => { zoomService.setZoomFactorAndSave(this.$zoomFactorSelect.val()); }); this.$zoomFactorSelect.on('change', () => { zoomService.setZoomFactorAndSave(this.$zoomFactorSelect.val()); });
this.$oneTabDisplaySelect.on('change', () => {
const hideTabRowForOneTab = this.$oneTabDisplaySelect.val() === 'hide' ? 'true' : 'false';
server.put('options/hideTabRowForOneTab/' + hideTabRowForOneTab)
.then(optionsService.reloadOptions);
});
this.$leftPaneMinWidth.on('change', async () => { this.$leftPaneMinWidth.on('change', async () => {
await server.put('options/leftPaneMinWidth/' + this.$leftPaneMinWidth.val()); await server.put('options/leftPaneMinWidth/' + this.$leftPaneMinWidth.val());
@ -204,8 +188,6 @@ export default class ApperanceOptions {
this.$zoomFactorSelect.prop('disabled', true); this.$zoomFactorSelect.prop('disabled', true);
} }
this.$oneTabDisplaySelect.val(options.hideTabRowForOneTab === 'true' ? 'hide' : 'show');
this.$leftPaneMinWidth.val(options.leftPaneMinWidth); this.$leftPaneMinWidth.val(options.leftPaneMinWidth);
this.$leftPaneWidthPercent.val(options.leftPaneWidthPercent); this.$leftPaneWidthPercent.val(options.leftPaneWidthPercent);

View File

@ -40,7 +40,6 @@ class TabRow {
this.eventListeners = {}; this.eventListeners = {};
this.el = el; this.el = el;
this.hideTabRowForOneTab = false;
this.setupStyleEl(); this.setupStyleEl();
this.setupEvents(); this.setupEvents();
@ -62,12 +61,6 @@ class TabRow {
} }
} }
setHideTabRowForOneTab(hideTabRowForOneTab) {
this.hideTabRowForOneTab = hideTabRowForOneTab;
this.setVisibility();
}
setupStyleEl() { setupStyleEl() {
this.styleEl = document.createElement('style'); this.styleEl = document.createElement('style');
this.el.appendChild(this.styleEl); this.el.appendChild(this.styleEl);
@ -92,7 +85,7 @@ class TabRow {
} }
setVisibility() { setVisibility() {
this.el.style.display = (this.tabEls.length > 1 || !this.hideTabRowForOneTab) ? "block" : "none"; this.el.style.display = "block";
} }
get tabEls() { get tabEls() {
@ -429,6 +422,4 @@ class TabRow {
const noteTabRowEl = document.querySelector('.note-tab-row'); const noteTabRowEl = document.querySelector('.note-tab-row');
const tabRow = new TabRow(noteTabRowEl); const tabRow = new TabRow(noteTabRowEl);
optionsService.addLoadListener(options => tabRow.setHideTabRowForOneTab(options.is('hideTabRowForOneTab')));
export default tabRow; export default tabRow;

View File

@ -23,7 +23,6 @@ const ALLOWED_OPTIONS = new Set([
'treeFontSize', 'treeFontSize',
'detailFontSize', 'detailFontSize',
'openTabs', 'openTabs',
'hideTabRowForOneTab',
'noteInfoWidget', 'noteInfoWidget',
'attributesWidget', 'attributesWidget',
'linkMapWidget', 'linkMapWidget',

View File

@ -79,7 +79,6 @@ const defaultOptions = [
{ name: 'similarNotesWidget', value: '{"enabled":true,"expanded":true,"position":600}', isSynced: false }, { name: 'similarNotesWidget', value: '{"enabled":true,"expanded":true,"position":600}', isSynced: false },
{ name: 'spellCheckEnabled', value: 'true', isSynced: false }, { name: 'spellCheckEnabled', value: 'true', isSynced: false },
{ name: 'spellCheckLanguageCode', value: 'en-US', isSynced: false }, { name: 'spellCheckLanguageCode', value: 'en-US', isSynced: false },
{ name: 'hideTabRowForOneTab', value: 'false', isSynced: false },
{ name: 'imageMaxWidthHeight', value: '1200', isSynced: true }, { name: 'imageMaxWidthHeight', value: '1200', isSynced: true },
{ name: 'imageJpegQuality', value: '75', isSynced: true }, { name: 'imageJpegQuality', value: '75', isSynced: true },
{ name: 'autoFixConsistencyIssues', value: 'true', isSynced: false }, { name: 'autoFixConsistencyIssues', value: 'true', isSynced: false },