diff options
author | Stan Hu <stanhu@gmail.com> | 2019-07-29 22:47:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-07-30 16:52:56 +0300 |
commit | c34138e09e964bd8c141d9ae7d360c7085affd16 (patch) | |
tree | c06b5c7ac077c277efb001d8655deedf54834e60 /app/assets/javascripts/pdf/page/index.vue | |
parent | 11f82c891ab82620982ef157d3a6783ee56a6997 (diff) |
Remove pdf.js deprecation warnings
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/page/index.vue')
-rw-r--r-- | app/assets/javascripts/pdf/page/index.vue | 4 |
1 files changed, 2 insertions, 2 deletions
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 => { |