Skip to content

Build your personal knowledge base with Trilium Notes

properly cleanup sidebar content after closing tab

zadamd3891006111e
diff --git a/src/public/javascripts/services/sidebar.js b/src/public/javascripts/services/sidebar.js
index 9363b4a6f3..24bf629c4e 100644
--- a/src/public/javascripts/services/sidebar.js
+++ b/src/public/javascripts/services/sidebar.js
@@ -154,6 +154,12 @@ class Sidebar {
this.$widgetContainer.empty().append(...widgetsToAppend);
}
+ remove() {
+ if (this.$widgetContainer) {
+ this.$widgetContainer.remove();
+ }
+ }
+
eventReceived(name, data) {
for (const widget of this.widgets) {
if (widget.eventReceived) {
diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js
index ee629b0e56..22461f36a0 100644
--- a/src/public/javascripts/services/tab_context.js
+++ b/src/public/javascripts/services/tab_context.js
@@ -438,6 +438,10 @@ class TabContext {
await this.saveNoteIfChanged();
this.$tabContent.remove();
}
+
+ if (this.sidebar) {
+ this.sidebar.remove();
+ }
}
cleanup() {
diff --git a/src/public/stylesheets/desktop.css b/src/public/stylesheets/desktop.css
index 065564a83f..0dc4825f8d 100644
--- a/src/public/stylesheets/desktop.css
+++ b/src/public/stylesheets/desktop.css
@@ -212,8 +212,8 @@ body {
.note-tab-row {
box-sizing: border-box;
position: relative;
- height: 33px;
- min-height: 33px;
+ height: 34px;
+ min-height: 34px;
width: 100%;
background: var(--main-background-color);
border-radius: 5px 5px 0 0;
diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css
index dd1714a61e..de3d4147d2 100644
--- a/src/public/stylesheets/style.css
+++ b/src/public/stylesheets/style.css
@@ -475,12 +475,13 @@ button.icon-button {
}
#global-menu-wrapper {
+ height: 35px;
border-bottom: 1px solid var(--main-border-color);
}
#global-menu button {
margin-right: 10px;
- height: 34px;
+ height: 33px;
border-bottom: none;
}