mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix ribbon tab not appearing
This commit is contained in:
parent
e57dee2f14
commit
7400a6723e
@ -176,6 +176,8 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||||||
if (activate) {
|
if (activate) {
|
||||||
const ribbonComponendId = $ribbonTitle.attr('data-ribbon-component-id');
|
const ribbonComponendId = $ribbonTitle.attr('data-ribbon-component-id');
|
||||||
|
|
||||||
|
const wasAlreadyActive = this.lastActiveComponentId === ribbonComponendId;
|
||||||
|
|
||||||
this.lastActiveComponentId = ribbonComponendId;
|
this.lastActiveComponentId = ribbonComponendId;
|
||||||
|
|
||||||
this.$tabContainer.find(`.ribbon-tab-title[data-ribbon-component-id="${ribbonComponendId}"]`).addClass("active");
|
this.$tabContainer.find(`.ribbon-tab-title[data-ribbon-component-id="${ribbonComponendId}"]`).addClass("active");
|
||||||
@ -183,7 +185,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
const activeChild = this.getActiveRibbonWidget();
|
const activeChild = this.getActiveRibbonWidget();
|
||||||
|
|
||||||
if (activeChild && refreshActiveTab) {
|
if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
|
||||||
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
|
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user