@konfuzio/document-validation-ui 0.1.3-pre-release-2 → 0.1.3-pre-release-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/css/app.css +1 -1
- package/dist/index.html +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/app.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/DocumentPage/ScrollingDocument.vue +6 -6
- package/src/components/DocumentPage/ScrollingPage.vue +11 -4
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
|
@@ -88,14 +88,14 @@ export default {
|
|
|
88
88
|
this.clientHeight = clientHeight;
|
|
89
89
|
},
|
|
90
90
|
/**
|
|
91
|
-
* Scrolls the ScrollingDocument to the offset specified by scrollTop
|
|
91
|
+
* Scrolls the ScrollingDocument to the offset specified by scrollTop & scrollLeft (if zoomed in)
|
|
92
92
|
* (i.e., another page).
|
|
93
93
|
*/
|
|
94
|
-
onPageJump(scrollTop) {
|
|
95
|
-
const
|
|
96
|
-
this.$refs.scrollingDocument.
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
onPageJump(scrollTop, scrollLeft) {
|
|
95
|
+
const scrollY = scrollTop - (this.$refs.scrollingDocument.offsetTop + 4); // + 4 due to margin between pages
|
|
96
|
+
const scrollX = scrollLeft - this.$refs.scrollingDocument.offsetLeft - 4; // - 4 to add more space before the entity
|
|
97
|
+
|
|
98
|
+
this.$refs.scrollingDocument.scroll(scrollX, scrollY);
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
};
|
|
@@ -109,7 +109,10 @@ export default {
|
|
|
109
109
|
// to the focused annotation.
|
|
110
110
|
this.$nextTick(() => {
|
|
111
111
|
// Scroll to the annotation
|
|
112
|
-
this.scrollTo(
|
|
112
|
+
this.scrollTo(
|
|
113
|
+
this.getYForBbox(this.documentAnnotationSelected.span),
|
|
114
|
+
this.getXForBbox(this.documentAnnotationSelected.span)
|
|
115
|
+
);
|
|
113
116
|
});
|
|
114
117
|
}
|
|
115
118
|
},
|
|
@@ -123,7 +126,7 @@ export default {
|
|
|
123
126
|
(this.page.number === number || this.page.number === number) &&
|
|
124
127
|
!this.isElementFocused
|
|
125
128
|
) {
|
|
126
|
-
this.$emit("page-jump", this.elementTop);
|
|
129
|
+
this.$emit("page-jump", this.elementTop, 0);
|
|
127
130
|
}
|
|
128
131
|
},
|
|
129
132
|
},
|
|
@@ -161,12 +164,16 @@ export default {
|
|
|
161
164
|
return this.bboxToRect(this.page, bbox).y;
|
|
162
165
|
},
|
|
163
166
|
|
|
167
|
+
getXForBbox(bbox) {
|
|
168
|
+
return this.bboxToRect(this.page, bbox).x;
|
|
169
|
+
},
|
|
170
|
+
|
|
164
171
|
/**
|
|
165
172
|
* Scroll to a relative position in the page. It gets added
|
|
166
173
|
* the page's element top and a padding margin.
|
|
167
174
|
*/
|
|
168
|
-
scrollTo(y) {
|
|
169
|
-
this.$emit("page-jump", this.elementTop + y - 80);
|
|
175
|
+
scrollTo(y, x) {
|
|
176
|
+
this.$emit("page-jump", this.elementTop + y - 80, x);
|
|
170
177
|
},
|
|
171
178
|
},
|
|
172
179
|
};
|