Skip to content

Commit

Permalink
work on #78 and created a condition for scrolling, see #93.
Browse files Browse the repository at this point in the history
It still seem buggy though
  • Loading branch information
telion2 committed Mar 15, 2018
1 parent 870b558 commit 8172271
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions views/components/analysis/analighter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
endhover: function (event) {
this.$emit('endhover', event);
},
starthover: function (textIndex) {
this.$emit('starthover', textIndex);
starthover: function (event) {
this.$emit('starthover', event);
},
editresearch: function (researchData) {
this.classestomark.POS = true;
Expand Down
5 changes: 4 additions & 1 deletion views/components/analysis/text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
return []
}
},
allowtexttoscroll: {type: Boolean, default: false}
},
data: function () {
return {
Expand Down Expand Up @@ -219,7 +220,9 @@
if (index > -1) {
this.isEntityHovered = true;
if (index == 0 && event.hoverstarted === "research") {
this.$el.scrollIntoView();
if (this.allowtexttoscroll) {
this.$el.scrollIntoView();
}
let data = {hoverended: "text", offsetstart: this.$el.getBoundingClientRect()};
this.$emit('endhover', data);
}
Expand Down
15 changes: 12 additions & 3 deletions views/components/analysis/textfeatureviewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
</div>
<!--right grid for result stuff -->
<div class="mdl-cell mdl-cell--6-col" style="max-height: 100%; margin:0; overflow-y: auto; width:50%">
<div class="mdl-cell mdl-cell--6-col" style="max-height: 100%; margin:0; overflow-y: auto; width:50%" ref="textviewport">
<keep-alive>
<component
:is="analysismode"
Expand All @@ -45,6 +45,7 @@
v-bind:selectedchain="selectedchain"
v-bind:hoverdata="hoverdata"
v-bind:wordtomarkonhoverdata="wordtomarkonhoverdata"
v-bind:allowtexttoscroll="allowTextToScroll"
v-bind:classestomark="classestomark"
v-bind:contentcontrol="contentcontrol"
v-on:togglesemanticlass="togglesemanticlass($event)"
Expand Down Expand Up @@ -102,10 +103,18 @@
},
data: function () {
return {
entitytoline: []
entitytoline: [],
}
},
computed: {
allowTextToScroll:function () {
if(this.$refs["textviewport"] !== undefined) {
return this.$refs["textviewport"].scrollHeight > this.$refs["textviewport"].clientHeight;
} else{
return false;
}
}
},
computed: {},
methods: {
updateclassestomark:function (newClassesToMark) {
this.$emit('updateclassestomark', newClassesToMark);
Expand Down

0 comments on commit 8172271

Please sign in to comment.