Skip to content

Commit

Permalink
DocumentLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Oct 2, 2024
1 parent 0371e6c commit 51891a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/js/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ async function pageMetadata(url) {
loadPDF(document.getElementById('input_pdf_upload').files[0]);
};

(function () {

document.addEventListener('DOMContentLoaded', function () {
if(window.location.hash && window.location.hash.match(/^\#http/)) {
pageMetadata(window.location.hash.replace(/^\#/, ''));
} else if(window.location.hash && window.location.hash.match(/^\#local/)) {
Expand All @@ -252,4 +253,4 @@ async function pageMetadata(url) {
window.addEventListener('hashchange', function() {
window.location.reload();
})
})();
});

0 comments on commit 51891a5

Please sign in to comment.