mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
fhemweb.js: wait for SVG loading to check for longpollSVG (Forum #60053)
git-svn-id: https://svn.fhem.de/fhem/trunk@12505 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
86d32b2075
commit
58c5d618ae
@ -8,6 +8,7 @@ var FW_isiOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/);
|
||||
var FW_scripts = {}, FW_links = {};
|
||||
var FW_docReady = false;
|
||||
var FW_root = "/fhem"; // root
|
||||
var embedLoadRetry = 100;
|
||||
|
||||
// createFn returns an HTML Element, which may contain
|
||||
// - setValueFn, which is called when data via longpoll arrives
|
||||
@ -627,7 +628,6 @@ FW_rawDef()
|
||||
{
|
||||
if(++i1 >= arr.length) {
|
||||
return FW_okDialog("Executed everything, no errors found.");
|
||||
return;
|
||||
}
|
||||
str += arr[i1];
|
||||
if(arr[i1].charAt(arr[i1].length-1) === "\\") {
|
||||
@ -755,11 +755,20 @@ FW_longpoll()
|
||||
var filter = $("body").attr("longpollfilter");
|
||||
if(filter == null)
|
||||
filter = "";
|
||||
var retry;
|
||||
if(filter == "") {
|
||||
$("embed").each(function() {
|
||||
if($(this.getSVGDocument()).length == 0 && !retry &&
|
||||
filter != ".*" && --embedLoadRetry > 0) {
|
||||
retry = 1;
|
||||
setTimeout(FW_longpoll, 100);
|
||||
return;
|
||||
}
|
||||
if($(this.getSVGDocument()).find("svg[flog]").attr("flog"))
|
||||
filter=".*";
|
||||
});
|
||||
if(retry)
|
||||
return;
|
||||
}
|
||||
|
||||
if(filter == "") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user