aboutsummaryrefslogtreecommitdiff
path: root/public/scripts/global_view.js
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 20:23:46 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 23:33:52 +0100
commit4a999fb6286bafcd070a1ebe53ceb5effacc8b59 (patch)
tree37116ac0606caf1b16567561d7e3971ee37a023c /public/scripts/global_view.js
parent6fbb62a2fccebef7f6516359917d1e74d2c84d1c (diff)
Améliorations chargement JS async
En particulier pour global_view.js. Suppression d'une requête avortée dans Chrome.
Diffstat (limited to 'public/scripts/global_view.js')
-rw-r--r--public/scripts/global_view.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/public/scripts/global_view.js b/public/scripts/global_view.js
index 7c2def775..2c95bdfb7 100644
--- a/public/scripts/global_view.js
+++ b/public/scripts/global_view.js
@@ -52,12 +52,19 @@ function init_global_view() {
init_stream_delegates($("#panel"));
}
-if (document.readyState && document.readyState !== 'loading') {
+function init_all_global_view() {
+ if (!(window.$ && window.init_stream_delegates)) {
+ window.setTimeout(init_all_global_view, 50); //Wait for all js to be loaded
+ return;
+ }
init_global_view();
init_close_panel();
+}
+
+if (document.readyState && document.readyState !== 'loading') {
+ init_all_global_view();
} else if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', function () {
- init_global_view();
- init_close_panel();
+ init_all_global_view();
}, false);
}