Skip to content

Commit

Permalink
fix: #227
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Jul 29, 2024
1 parent 288e08d commit 5db779b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/sentence/SentenceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
@focus="activateFocus(sentence.sent_id)"
>
<q-card flat>
<q-card-section :class="($q.dark.isActive ? '' : '') + ' scrollable'" :ref="(user as string)" @scroll="synchronizeScroll">
<q-card-section :class="($q.dark.isActive ? '' : '') + ' scrollable'" :id="'tab_' + user" @scroll="synchronizeScroll">
<VueDepTree
v-if="reactiveSentencesObj"
:card-id="index"
Expand Down Expand Up @@ -373,6 +373,7 @@ export default defineComponent({
data() {
const hasPendingChanges: { [key: string]: boolean } = {};
const reactiveSentencesObj: reactive_sentences_obj_t = {};
const horizontalScrollPos: number = 0;
return {
sentenceBus: sentenceBusFactory(),
exportedConll: '',
Expand All @@ -388,6 +389,7 @@ export default defineComponent({
showSentSegmentationDial: false,
hasPendingChanges,
tags: [],
horizontalScrollPos,
};
},
Expand Down Expand Up @@ -575,6 +577,7 @@ export default defineComponent({
else {
this.sentenceText = this.sentenceData.sentence;
}
document.getElementById(`tab_${this.openTabUser}`)?.scrollTo({ left: this.horizontalScrollPos });
},
openMetaDialog() {
this.sentenceBus.emit('open:metaDialog', { userId: this.openTabUser });
Expand Down Expand Up @@ -654,9 +657,7 @@ export default defineComponent({
}
},
synchronizeScroll(event: Event) {
for (const user of Object.keys(this.filteredConlls)) {
console.log(user)
}
this.horizontalScrollPos = (event.target as HTMLElement).scrollLeft;
}
},
});
Expand Down

0 comments on commit 5db779b

Please sign in to comment.