Skip to content

Commit

Permalink
gs_index: injecting the cursor to the corpus
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 17, 2024
1 parent 5bef2e8 commit 647ebb9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/backend/gs_index/src/components/Corpus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
type: Boolean,
default: false,
},
cursor: {
type: Number,
default: 0,
}
},
components: {
Paragraph,
Expand All @@ -32,7 +28,6 @@
api: new GsApi(),
sharedState,
currentP: this.cursor,
psPerScreen: 8,
showPre: false,
Expand All @@ -43,6 +38,16 @@
isCorpusVisible() {
return this.mounted && sharedState.currentOpenCorpus == this.corpus_id;
},
currentP: {
get() {
if (!this.corpus.cursor)
this.corpus.cursor = 0;
return this.corpus.cursor;
},
set(value) {
this.corpus.cursor = value;
}
},
visibleParagraphs() {
const targets = Array.from({ length: this.psPerScreen }, (_, i) => this.currentP + i);
Expand Down

0 comments on commit 647ebb9

Please sign in to comment.