mirror of
https://github.com/zadam/trilium.git
synced 2024-11-10 09:02:48 +08:00
Stop note map simulation if not visible
This commit is contained in:
parent
b5ef09e779
commit
76064fbed4
4 changed files with 16 additions and 0 deletions
|
@ -198,6 +198,10 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
const activeChild = this.getActiveRibbonWidget();
|
||||
if (activeChild) {
|
||||
activeChild.handleEvent('deactivated', {});
|
||||
}
|
||||
this.lastActiveComponentId = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -23,4 +23,8 @@ export default class NoteMapTypeWidget extends TypeWidget {
|
|||
async doRefresh(note) {
|
||||
await this.noteMapWidget.refresh();
|
||||
}
|
||||
|
||||
deactivatedEvent() {
|
||||
this.noteMapWidget.deactivatedEvent();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue