projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e380cf5
)
luci-base: xhr.js: defer starting poll queue
author
Jo-Philipp Wich
<jo@mein.io>
Fri, 22 Jun 2018 07:39:30 +0000
(09:39 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Fri, 22 Jun 2018 07:42:15 +0000
(09:42 +0200)
Defer the start of the queue poll loop until the document has been loaded.
This allows all XHR.poll() invocations on the page to register their
handlers before the first batch of requests is made.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/xhr.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/xhr.js
b/modules/luci-base/htdocs/luci-static/resources/xhr.js
index de4476cdd32412a7bbf45e8c507a5f8025820acc..f1537a448133cb657131bb51ac5b66019ec883de 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/xhr.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/xhr.js
@@
-204,7
+204,6
@@
XHR.poll = function(interval, url, data, callback, post)
};
XHR._q.push(e);
- XHR.run();
return e;
}
@@
-260,3
+259,5
@@
XHR.running = function()
{
return !!(XHR._r && XHR._i);
}
+
+document.addEventListener('DOMContentLoaded', XHR.run);