Skip to content

Commit

Permalink
Fixed issue with accordions not appearing open
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDinis committed Aug 31, 2024
1 parent 0b37ba0 commit 5806356
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/DocumentAnnotations/AnnotationFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {
watch: {
search() {
if (this.search != "") {
if (this.search.length > 0) {
this.$emit("openAll");
}
if (this.search != this.annotationSearch) {
Expand Down
11 changes: 10 additions & 1 deletion src/components/DocumentAnnotations/DocumentAnnotations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ export default {
oldAnnotationSets
);
},
getAnnotationsFiltered(newFiltered, oldFiltered) {
this.loadAccordions(
newFiltered.annotationSets,
oldFiltered.annotationSets
);
},
annotationId(newAnnotationId) {
if (newAnnotationId) {
const annotationSet = this.annotationSetOfAnnotation(newAnnotationId);
Expand Down Expand Up @@ -319,11 +325,13 @@ export default {
newAnnotationSets.forEach((newAnnotationSet) => {
const existed = oldAnnotationSets.find(
(oldAnnotationSet) =>
oldAnnotationSet &&
newAnnotationSet &&
oldAnnotationSet.id &&
newAnnotationSet.id &&
oldAnnotationSet.id === newAnnotationSet.id
);
if (!existed && newAnnotationSet.id !== null) {
if (!existed && newAnnotationSet && newAnnotationSet.id !== null) {
annotationSetsCreated.push(newAnnotationSet);
}
});
Expand All @@ -332,6 +340,7 @@ export default {
newAnnotationSets.forEach((newAnnotationSet, index) => {
const wasOpen = annotationSetsOpened.find(
(annotationSetOpened) =>
annotationSetOpened &&
annotationSetOpened.id &&
newAnnotationSet.id &&
newAnnotationSet.id === annotationSetOpened.id
Expand Down

0 comments on commit 5806356

Please sign in to comment.