mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Support for PDF hot reload in PDF.js
This commit is contained in:
parent
2f3463d5d5
commit
712598b94c
9
resources/js/clients/shared/pdf.js
vendored
9
resources/js/clients/shared/pdf.js
vendored
@ -80,6 +80,15 @@ class PDF {
|
|||||||
.getElementById('zoom-out')
|
.getElementById('zoom-out')
|
||||||
.addEventListener('click', () => this.handleZoomChange());
|
.addEventListener('click', () => this.handleZoomChange());
|
||||||
|
|
||||||
|
document
|
||||||
|
.querySelector('meta[name=pdf-url]')
|
||||||
|
.addEventListener('change', () => {
|
||||||
|
this.canvas.getContext('2d').clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
this.url = document.querySelector("meta[name='pdf-url']").content;
|
||||||
|
|
||||||
|
this.handle();
|
||||||
|
})
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user