This commit is contained in:
Joseph Cheung 2023-03-06 10:32:41 +08:00
parent abb8c01b2a
commit 877948b29d
2 changed files with 6 additions and 0 deletions

View file

@ -1303,6 +1303,7 @@ function modal_open(url, num)
iframe.contentDocument.addEventListener("webviewerloaded", function() { iframe.contentDocument.addEventListener("webviewerloaded", function() {
iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() { iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() {
iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) { iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) {
console.log("pdf loaded")
resolve("success"); resolve("success");
}); });
}); });
@ -1310,10 +1311,12 @@ function modal_open(url, num)
} }
else if (iframe.attachEvent) { else if (iframe.attachEvent) {
iframe.attachEvent("onload", function() { iframe.attachEvent("onload", function() {
console.log("page loaded")
resolve("success"); resolve("success");
}); });
} else{ } else{
iframe.onload = function() { iframe.onload = function() {
console.log("page loaded")
resolve("success"); resolve("success");
}; };
} }

View file

@ -1303,6 +1303,7 @@ function modal_open(url, num)
iframe.contentDocument.addEventListener("webviewerloaded", function() { iframe.contentDocument.addEventListener("webviewerloaded", function() {
iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() { iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() {
iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) { iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) {
console.log("pdf loaded")
resolve("success"); resolve("success");
}); });
}); });
@ -1310,10 +1311,12 @@ function modal_open(url, num)
} }
else if (iframe.attachEvent) { else if (iframe.attachEvent) {
iframe.attachEvent("onload", function() { iframe.attachEvent("onload", function() {
console.log("page loaded")
resolve("success"); resolve("success");
}); });
} else{ } else{
iframe.onload = function() { iframe.onload = function() {
console.log("page loaded")
resolve("success"); resolve("success");
}; };
} }