This commit is contained in:
Joseph Cheung 2023-03-06 10:11:33 +08:00
parent 07a7f9fac6
commit 9b32ed4494
2 changed files with 12 additions and 4 deletions

View file

@ -1304,9 +1304,13 @@ function modal_open(url, num)
resolve("success"); resolve("success");
}); });
} else if (num=='pdf') { } else if (num=='pdf') {
iframe.contentDocument.addEventListener('pagesloaded', function (e) { iframe.contentDocument.addEventListener("webviewerloaded", function() {
PDFViewerApplication.initializedPromise.then(function() {
PDFViewerApplication.eventBus.on("documentloaded", function(event) {
resolve("success"); resolve("success");
}, true); });
});
});
}else{ }else{
iframe.onload = function() { iframe.onload = function() {
resolve("success"); resolve("success");

View file

@ -1304,9 +1304,13 @@ function modal_open(url, num)
resolve("success"); resolve("success");
}); });
} else if (num=='pdf') { } else if (num=='pdf') {
iframe.contentDocument.addEventListener('pagesloaded', function (e) { iframe.contentDocument.addEventListener("webviewerloaded", function() {
PDFViewerApplication.initializedPromise.then(function() {
PDFViewerApplication.eventBus.on("documentloaded", function(event) {
resolve("success"); resolve("success");
}, true); });
});
});
}else{ }else{
iframe.onload = function() { iframe.onload = function() {
resolve("success"); resolve("success");