properly cleanup sidebar content after closing tab

This commit is contained in:
zadam 2019-12-23 21:46:37 +01:00
parent ea7257a5b2
commit d389100611
4 changed files with 14 additions and 3 deletions

View File

@ -154,6 +154,12 @@ class Sidebar {
this.$widgetContainer.empty().append(...widgetsToAppend); this.$widgetContainer.empty().append(...widgetsToAppend);
} }
remove() {
if (this.$widgetContainer) {
this.$widgetContainer.remove();
}
}
eventReceived(name, data) { eventReceived(name, data) {
for (const widget of this.widgets) { for (const widget of this.widgets) {
if (widget.eventReceived) { if (widget.eventReceived) {

View File

@ -438,6 +438,10 @@ class TabContext {
await this.saveNoteIfChanged(); await this.saveNoteIfChanged();
this.$tabContent.remove(); this.$tabContent.remove();
} }
if (this.sidebar) {
this.sidebar.remove();
}
} }
cleanup() { cleanup() {

View File

@ -212,8 +212,8 @@ body {
.note-tab-row { .note-tab-row {
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
height: 33px; height: 34px;
min-height: 33px; min-height: 34px;
width: 100%; width: 100%;
background: var(--main-background-color); background: var(--main-background-color);
border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0;

View File

@ -475,12 +475,13 @@ button.icon-button {
} }
#global-menu-wrapper { #global-menu-wrapper {
height: 35px;
border-bottom: 1px solid var(--main-border-color); border-bottom: 1px solid var(--main-border-color);
} }
#global-menu button { #global-menu button {
margin-right: 10px; margin-right: 10px;
height: 34px; height: 33px;
border-bottom: none; border-bottom: none;
} }