mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
converting sidebar widgets to normal widgets
This commit is contained in:
@@ -5,7 +5,6 @@ import bundleService from "./bundle.js";
|
||||
import Attributes from "./attributes.js";
|
||||
import utils from "./utils.js";
|
||||
import optionsService from "./options.js";
|
||||
import Sidebar from "./sidebar.js";
|
||||
import appContext from "./app_context.js";
|
||||
|
||||
let showSidebarInNewTab = true;
|
||||
@@ -39,14 +38,6 @@ class TabContext {
|
||||
this.noteChangeDisabled = false;
|
||||
this.isNoteChanged = false;
|
||||
this.attributes = new Attributes(this);
|
||||
|
||||
if (utils.isDesktop()) {
|
||||
const sidebarState = this.state.sidebar || {
|
||||
visible: showSidebarInNewTab
|
||||
};
|
||||
|
||||
this.sidebar = new Sidebar(this, sidebarState);
|
||||
}
|
||||
}
|
||||
|
||||
async setNote(note, notePath) {
|
||||
@@ -70,10 +61,6 @@ class TabContext {
|
||||
|
||||
this.setCurrentNotePathToHash();
|
||||
|
||||
if (this.sidebar) {
|
||||
this.sidebar.noteLoaded(); // load async
|
||||
}
|
||||
|
||||
this.noteChangeDisabled = true;
|
||||
|
||||
try {
|
||||
@@ -118,10 +105,6 @@ class TabContext {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.sidebar) {
|
||||
this.sidebar.show();
|
||||
}
|
||||
|
||||
this.setCurrentNotePathToHash();
|
||||
this.setTitleBar();
|
||||
}
|
||||
@@ -254,10 +237,6 @@ class TabContext {
|
||||
await this.saveNoteIfChanged();
|
||||
this.$tabContent.remove();
|
||||
}
|
||||
|
||||
if (this.sidebar) {
|
||||
this.sidebar.remove();
|
||||
}
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
@@ -274,10 +253,6 @@ class TabContext {
|
||||
}
|
||||
|
||||
this.attributes.eventReceived(name, data);
|
||||
|
||||
if (this.sidebar) {
|
||||
this.sidebar.eventReceived(name, data);
|
||||
}
|
||||
}
|
||||
|
||||
getTabState() {
|
||||
@@ -288,8 +263,7 @@ class TabContext {
|
||||
return {
|
||||
tabId: this.tabId,
|
||||
notePath: this.notePath,
|
||||
active: this.tabRow.activeTabEl === this.$tab[0],
|
||||
sidebar: this.sidebar && this.sidebar.getSidebarState()
|
||||
active: this.tabRow.activeTabEl === this.$tab[0]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user