mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
organization: load PDF from cache
This commit is contained in:
parent
cf9c4958bd
commit
7561fae205
2 changed files with 4 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ async function loadFileFromCache(cacheUrl, pageUrl) {
|
|||
type: 'application/pdf'
|
||||
}));
|
||||
document.getElementById('input_pdf_upload').files = dataTransfer.files;
|
||||
document.getElementById('input_pdf_upload').dispatchEvent(new Event("change"));
|
||||
}
|
||||
|
||||
async function storeFileInCache() {
|
||||
|
|
|
|||
|
|
@ -924,6 +924,9 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
let hashUrl = window.location.hash.replace(/^\#/, '');
|
||||
pageUpload();
|
||||
uploadFromUrl(hashUrl);
|
||||
} else if (window.location.hash && canUseCache()) {
|
||||
pageUpload()
|
||||
loadFileFromCache('/pdf/'+window.location.hash.replace(/^\#/, ''));
|
||||
} else {
|
||||
pageUpload();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue