mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
9b32ed4494
commit
abb8c01b2a
2 changed files with 18 additions and 16 deletions
|
@ -1299,19 +1299,20 @@ function modal_open(url, num)
|
|||
var iframePromise = new Promise((resolve, reject) => {
|
||||
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
||||
iframe.src = url;
|
||||
if (iframe.attachEvent&&num!='pdf') {
|
||||
if (num=='pdf') {
|
||||
iframe.contentDocument.addEventListener("webviewerloaded", function() {
|
||||
iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() {
|
||||
iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) {
|
||||
resolve("success");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
else if (iframe.attachEvent) {
|
||||
iframe.attachEvent("onload", function() {
|
||||
resolve("success");
|
||||
});
|
||||
} else if (num=='pdf') {
|
||||
iframe.contentDocument.addEventListener("webviewerloaded", function() {
|
||||
PDFViewerApplication.initializedPromise.then(function() {
|
||||
PDFViewerApplication.eventBus.on("documentloaded", function(event) {
|
||||
resolve("success");
|
||||
});
|
||||
});
|
||||
});
|
||||
}else{
|
||||
} else{
|
||||
iframe.onload = function() {
|
||||
resolve("success");
|
||||
};
|
||||
|
|
|
@ -1299,19 +1299,20 @@ function modal_open(url, num)
|
|||
var iframePromise = new Promise((resolve, reject) => {
|
||||
var iframe = document.querySelector("#iframe-wrapper > iframe");
|
||||
iframe.src = url;
|
||||
if (iframe.attachEvent&&num!='pdf') {
|
||||
if (num=='pdf') {
|
||||
iframe.contentDocument.addEventListener("webviewerloaded", function() {
|
||||
iframe.contentWindow.PDFViewerApplication.initializedPromise.then(function() {
|
||||
iframe.contentWindow.PDFViewerApplication.eventBus.on("documentloaded", function(event) {
|
||||
resolve("success");
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
else if (iframe.attachEvent) {
|
||||
iframe.attachEvent("onload", function() {
|
||||
resolve("success");
|
||||
});
|
||||
} else if (num=='pdf') {
|
||||
iframe.contentDocument.addEventListener("webviewerloaded", function() {
|
||||
PDFViewerApplication.initializedPromise.then(function() {
|
||||
PDFViewerApplication.eventBus.on("documentloaded", function(event) {
|
||||
resolve("success");
|
||||
});
|
||||
});
|
||||
});
|
||||
}else{
|
||||
} else{
|
||||
iframe.onload = function() {
|
||||
resolve("success");
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue