Skip to content

Commit

Permalink
gs_index: fixedHead scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 17, 2024
1 parent e003c9f commit 42402c7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/backend/gs_index/src/components/Corpus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
sharedState.currentOpenCorpus = "";
else
sharedState.currentOpenCorpus = this.corpus_id;
if (this.fixedHeader) {
this.fixedHeader = false;
setTimeout(() => this.scrollToOriginalHeader(), 500);
}
},
download() {
const json = JSON.stringify(this.corpus);
Expand Down Expand Up @@ -232,7 +237,6 @@
timeout = setTimeout(() => func.apply(this, args), wait);
};
},
handleIntersection(entries) {
entries.forEach((entry) =>
this.fixedHeader = (
Expand All @@ -242,6 +246,12 @@
)
);
},
scrollToOriginalHeader() {
const headerElement = this.$refs.header;
headerElement.scrollIntoView({
behavior: 'smooth'
});
},
onAnnotateP(p_index) {
this.annotate([p_index]);
Expand Down Expand Up @@ -340,7 +350,7 @@
background-color: white;
z-index: 1000;
padding: 2%;
//padding: 2%;
border-bottom: 1px solid lightgray;
}
</style>

0 comments on commit 42402c7

Please sign in to comment.