Skip to content

Commit

Permalink
refactor: scroll to annotation when set from route query
Browse files Browse the repository at this point in the history
  • Loading branch information
rwd committed Nov 21, 2024
1 parent 4acb5a1 commit ea71118
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/portal/src/components/media/MediaAnnotationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
this.scrollActiveAnnotationToCentre();
}
},
'$fetchState.pending'(pending) {
!pending && this.scrollActiveAnnotationToCentre();
},
// TODO: should this watcher go into useItemMediaPresentation?
annotationUri() {
!this.searching && this.$fetch();
Expand Down Expand Up @@ -186,8 +183,10 @@
if (this.$route.query.anno !== this.activeAnnotation?.id) {
const activeAnnotation = this.annotations.find((anno) => anno.id === this.$route.query.anno) || this.annotationSearchResults.find((anno) => anno.id === this.$route.query.anno);
this.setActiveAnnotation(activeAnnotation || null);
process.client && this.scrollActiveAnnotationToCentre('instant');
}
this.$nextTick(() => {
process.client && this.scrollActiveAnnotationToCentre('instant');
});
}
}
};
Expand Down

0 comments on commit ea71118

Please sign in to comment.