Skip to content
Snippets Groups Projects
Commit 11308843 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Switch fabric to a dynamic import

We only need it for the preview, so we can load it in the background
parent 0da6ed2e
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,6 @@ import {MiniSpinner} from 'vpu-common'; ...@@ -8,7 +8,6 @@ import {MiniSpinner} from 'vpu-common';
import * as commonUtils from "vpu-common/utils"; import * as commonUtils from "vpu-common/utils";
import * as commonStyles from 'vpu-common/styles'; import * as commonStyles from 'vpu-common/styles';
import pdfjs from 'pdfjs-dist'; import pdfjs from 'pdfjs-dist';
import {fabric} from 'fabric';
const i18n = createI18nInstance(); const i18n = createI18nInstance();
...@@ -83,7 +82,8 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) { ...@@ -83,7 +82,8 @@ export class PdfPreview extends ScopedElementsMixin(VPULitElement) {
window.addEventListener('resize', this._onWindowResize); window.addEventListener('resize', this._onWindowResize);
this.updateComplete.then(() => { this.updateComplete.then(async () => {
const fabric = (await import('fabric')).fabric;
that.canvas = that._('#pdf-canvas'); that.canvas = that._('#pdf-canvas');
// this._('#upload-pdf-input').addEventListener('change', function() { // this._('#upload-pdf-input').addEventListener('change', function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment