mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
removed hideTabRowForOneTab option
This commit is contained in:
parent
bcf163f8a1
commit
6986c201dd
@ -9,24 +9,16 @@ const TPL = `
|
||||
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<div class="col-4">
|
||||
<div class="col-6">
|
||||
<label for="theme-select">Theme</label>
|
||||
<select class="form-control" id="theme-select"></select>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<div class="col-6">
|
||||
<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"/>
|
||||
</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>
|
||||
|
||||
<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.$zoomFactorSelect = $("#zoom-factor-select");
|
||||
this.$oneTabDisplaySelect = $("#one-tab-display-select");
|
||||
this.$leftPaneMinWidth = $("#left-pane-min-width");
|
||||
this.$leftPaneWidthPercent = $("#left-pane-width-percent");
|
||||
this.$mainFontSize = $("#main-font-size");
|
||||
@ -141,13 +132,6 @@ export default class ApperanceOptions {
|
||||
|
||||
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 () => {
|
||||
await server.put('options/leftPaneMinWidth/' + this.$leftPaneMinWidth.val());
|
||||
|
||||
@ -204,8 +188,6 @@ export default class ApperanceOptions {
|
||||
this.$zoomFactorSelect.prop('disabled', true);
|
||||
}
|
||||
|
||||
this.$oneTabDisplaySelect.val(options.hideTabRowForOneTab === 'true' ? 'hide' : 'show');
|
||||
|
||||
this.$leftPaneMinWidth.val(options.leftPaneMinWidth);
|
||||
this.$leftPaneWidthPercent.val(options.leftPaneWidthPercent);
|
||||
|
||||
|
@ -40,7 +40,6 @@ class TabRow {
|
||||
this.eventListeners = {};
|
||||
|
||||
this.el = el;
|
||||
this.hideTabRowForOneTab = false;
|
||||
|
||||
this.setupStyleEl();
|
||||
this.setupEvents();
|
||||
@ -62,12 +61,6 @@ class TabRow {
|
||||
}
|
||||
}
|
||||
|
||||
setHideTabRowForOneTab(hideTabRowForOneTab) {
|
||||
this.hideTabRowForOneTab = hideTabRowForOneTab;
|
||||
|
||||
this.setVisibility();
|
||||
}
|
||||
|
||||
setupStyleEl() {
|
||||
this.styleEl = document.createElement('style');
|
||||
this.el.appendChild(this.styleEl);
|
||||
@ -92,7 +85,7 @@ class TabRow {
|
||||
}
|
||||
|
||||
setVisibility() {
|
||||
this.el.style.display = (this.tabEls.length > 1 || !this.hideTabRowForOneTab) ? "block" : "none";
|
||||
this.el.style.display = "block";
|
||||
}
|
||||
|
||||
get tabEls() {
|
||||
@ -429,6 +422,4 @@ class TabRow {
|
||||
const noteTabRowEl = document.querySelector('.note-tab-row');
|
||||
const tabRow = new TabRow(noteTabRowEl);
|
||||
|
||||
optionsService.addLoadListener(options => tabRow.setHideTabRowForOneTab(options.is('hideTabRowForOneTab')));
|
||||
|
||||
export default tabRow;
|
@ -23,7 +23,6 @@ const ALLOWED_OPTIONS = new Set([
|
||||
'treeFontSize',
|
||||
'detailFontSize',
|
||||
'openTabs',
|
||||
'hideTabRowForOneTab',
|
||||
'noteInfoWidget',
|
||||
'attributesWidget',
|
||||
'linkMapWidget',
|
||||
|
@ -79,7 +79,6 @@ const defaultOptions = [
|
||||
{ name: 'similarNotesWidget', value: '{"enabled":true,"expanded":true,"position":600}', isSynced: false },
|
||||
{ name: 'spellCheckEnabled', value: 'true', isSynced: false },
|
||||
{ name: 'spellCheckLanguageCode', value: 'en-US', isSynced: false },
|
||||
{ name: 'hideTabRowForOneTab', value: 'false', isSynced: false },
|
||||
{ name: 'imageMaxWidthHeight', value: '1200', isSynced: true },
|
||||
{ name: 'imageJpegQuality', value: '75', isSynced: true },
|
||||
{ name: 'autoFixConsistencyIssues', value: 'true', isSynced: false },
|
||||
|
Loading…
x
Reference in New Issue
Block a user