This commit is contained in:
Arne Keller 2024-05-30 13:48:25 +08:00 committed by GitHub
commit 9a55a44d4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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

@ -219,6 +219,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();
}
}