diff --git a/src/public/app/widgets/containers/ribbon_container.js b/src/public/app/widgets/containers/ribbon_container.js index c75776a99..922e9fa26 100644 --- a/src/public/app/widgets/containers/ribbon_container.js +++ b/src/public/app/widgets/containers/ribbon_container.js @@ -198,6 +198,10 @@ export default class RibbonContainer extends NoteContextAwareWidget { } } } else { + const activeChild = this.getActiveRibbonWidget(); + if (activeChild) { + activeChild.handleEvent('deactivated', {}); + } this.lastActiveComponentId = null; } } diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js index a54e40359..0c486f6a3 100644 --- a/src/public/app/widgets/note_detail.js +++ b/src/public/app/widgets/note_detail.js @@ -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(); } } diff --git a/src/public/app/widgets/note_map.js b/src/public/app/widgets/note_map.js index ab7d2c0e0..4eb87a3b4 100644 --- a/src/public/app/widgets/note_map.js +++ b/src/public/app/widgets/note_map.js @@ -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; diff --git a/src/public/app/widgets/type_widgets/note_map.js b/src/public/app/widgets/type_widgets/note_map.js index 895d2ea7b..cbadaae08 100644 --- a/src/public/app/widgets/type_widgets/note_map.js +++ b/src/public/app/widgets/type_widgets/note_map.js @@ -23,4 +23,8 @@ export default class NoteMapTypeWidget extends TypeWidget { async doRefresh(note) { await this.noteMapWidget.refresh(); } + + deactivatedEvent() { + this.noteMapWidget.deactivatedEvent(); + } }