Stop note map simulation if not visible

This commit is contained in:
FliegendeWurst 2023-08-18 17:39:34 +02:00
parent b5ef09e779
commit 76064fbed4
4 changed files with 16 additions and 0 deletions

View file

@ -198,6 +198,10 @@ export default class RibbonContainer extends NoteContextAwareWidget {
}
}
} else {
const activeChild = this.getActiveRibbonWidget();
if (activeChild) {
activeChild.handleEvent('deactivated', {});
}
this.lastActiveComponentId = null;
}
}

View file

@ -217,6 +217,9 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
async beforeNoteSwitchEvent({noteContext}) {
if (this.isNoteContext(noteContext.ntxId)) {
for (const x of this.children) {
x.handleEvent("deactivated", {});
}
await this.spacedUpdate.updateNowIfNecessary();
}
}

View file

@ -138,6 +138,11 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
this.renderData(data);
}
deactivatedEvent() {
this.graph.stopAnimation();
this.graph = null;
}
getMapRootNoteId() {
if (this.widgetMode === 'ribbon') {
return this.noteId;

View file

@ -23,4 +23,8 @@ export default class NoteMapTypeWidget extends TypeWidget {
async doRefresh(note) {
await this.noteMapWidget.refresh();
}
deactivatedEvent() {
this.noteMapWidget.deactivatedEvent();
}
}