mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Stop note map simulation if not visible
This commit is contained in:
parent
b5ef09e779
commit
76064fbed4
@ -198,6 +198,10 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
const activeChild = this.getActiveRibbonWidget();
|
||||||
|
if (activeChild) {
|
||||||
|
activeChild.handleEvent('deactivated', {});
|
||||||
|
}
|
||||||
this.lastActiveComponentId = null;
|
this.lastActiveComponentId = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,6 +217,9 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
async beforeNoteSwitchEvent({noteContext}) {
|
async beforeNoteSwitchEvent({noteContext}) {
|
||||||
if (this.isNoteContext(noteContext.ntxId)) {
|
if (this.isNoteContext(noteContext.ntxId)) {
|
||||||
|
for (const x of this.children) {
|
||||||
|
x.handleEvent("deactivated", {});
|
||||||
|
}
|
||||||
await this.spacedUpdate.updateNowIfNecessary();
|
await this.spacedUpdate.updateNowIfNecessary();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,6 +138,11 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
|
|||||||
this.renderData(data);
|
this.renderData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deactivatedEvent() {
|
||||||
|
this.graph.stopAnimation();
|
||||||
|
this.graph = null;
|
||||||
|
}
|
||||||
|
|
||||||
getMapRootNoteId() {
|
getMapRootNoteId() {
|
||||||
if (this.widgetMode === 'ribbon') {
|
if (this.widgetMode === 'ribbon') {
|
||||||
return this.noteId;
|
return this.noteId;
|
||||||
|
@ -23,4 +23,8 @@ export default class NoteMapTypeWidget extends TypeWidget {
|
|||||||
async doRefresh(note) {
|
async doRefresh(note) {
|
||||||
await this.noteMapWidget.refresh();
|
await this.noteMapWidget.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deactivatedEvent() {
|
||||||
|
this.noteMapWidget.deactivatedEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user