summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pdf
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-29 12:47:40 -0700
committerStan Hu <stanhu@gmail.com>2019-07-30 06:52:56 -0700
commitc34138e09e964bd8c141d9ae7d360c7085affd16 (patch)
treec06b5c7ac077c277efb001d8655deedf54834e60 /app/assets/javascripts/pdf
parent11f82c891ab82620982ef157d3a6783ee56a6997 (diff)
downloadgitlab-ce-c34138e09e964bd8c141d9ae7d360c7085affd16.tar.gz
Remove pdf.js deprecation warningssh-remove-pdfjs-deprecations
1. `page.getViewpoint()` now takes in JSON instead of an integer. 2. Promises are returned from loading and rendering tasks. See https://mozilla.github.io/pdf.js/examples/index.html for more details.
Diffstat (limited to 'app/assets/javascripts/pdf')
-rw-r--r--app/assets/javascripts/pdf/index.vue2
-rw-r--r--app/assets/javascripts/pdf/page/index.vue4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/pdf/index.vue b/app/assets/javascripts/pdf/index.vue
index 14640c172cd..bbbd9789dc9 100644
--- a/app/assets/javascripts/pdf/index.vue
+++ b/app/assets/javascripts/pdf/index.vue
@@ -39,7 +39,7 @@ export default {
cMapUrl: '/assets/webpack/cmaps/',
cMapPacked: true,
})
- .then(this.renderPages)
+ .promise.then(this.renderPages)
.then(pages => {
this.pages = pages;
this.$emit('pdflabload');
diff --git a/app/assets/javascripts/pdf/page/index.vue b/app/assets/javascripts/pdf/page/index.vue
index d933fdf220a..65f84e75e86 100644
--- a/app/assets/javascripts/pdf/page/index.vue
+++ b/app/assets/javascripts/pdf/page/index.vue
@@ -18,7 +18,7 @@ export default {
},
computed: {
viewport() {
- return this.page.getViewport(this.scale);
+ return this.page.getViewport({ scale: this.scale });
},
context() {
return this.$refs.canvas.getContext('2d');
@@ -36,7 +36,7 @@ export default {
this.rendering = true;
this.page
.render(this.renderContext)
- .then(() => {
+ .promise.then(() => {
this.rendering = false;
})
.catch(error => {