Commit 53369f58 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'sh-remove-pdfjs-deprecations' into 'master'

Remove pdf.js deprecation warnings

See merge request gitlab-org/gitlab-ce!31253
parents d1c71c7c c34138e0
......@@ -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');
......
......@@ -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 => {
......
---
title: Remove pdf.js deprecation warnings
merge_request: 31253
author:
type: fixed
......@@ -17,7 +17,7 @@ describe('Page component', () => {
pdfjsLib.GlobalWorkerOptions.workerSrc = workerSrc;
pdfjsLib
.getDocument(testPDF)
.then(pdf => pdf.getPage(1))
.promise.then(pdf => pdf.getPage(1))
.then(page => {
testPage = page;
})
......@@ -31,7 +31,8 @@ describe('Page component', () => {
it('renders the page when mounting', done => {
const promise = Promise.resolve();
spyOn(testPage, 'render').and.callFake(() => promise);
spyOn(testPage, 'render').and.returnValue({ promise });
vm = mountComponent(Component, {
page: testPage,
number: 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment