From 0062191db48aacf2c3e2889aa0614a7b83b445b2 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 31 Jan 2019 16:52:27 +0530 Subject: [PATCH] don't start animation twice --- static/js/oml.js | 6 ++++-- static/js/oml.update.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/static/js/oml.js b/static/js/oml.js index 182c825..9f14921 100644 --- a/static/js/oml.js +++ b/static/js/oml.js @@ -287,8 +287,10 @@ // FF3.6 document.body can be undefined here window.onload = function() { document.body.style.margin = 0; - document.body.appendChild(loadingScreen); - startAnimation(); + if (!animationInterval) { + document.body.appendChild(loadingScreen); + startAnimation(); + } }; // IE8 does not call onload if already loaded before set document.body && window.onload(); diff --git a/static/js/oml.update.js b/static/js/oml.update.js index aec6d55..14961ad 100644 --- a/static/js/oml.update.js +++ b/static/js/oml.update.js @@ -121,8 +121,10 @@ // FF3.6 document.body can be undefined here window.onload = function() { document.body.style.margin = 0; - document.body.appendChild(loadingScreen); - startAnimation(); + if (!animationInterval) { + document.body.appendChild(loadingScreen); + startAnimation(); + } }; // IE8 does not call onload if already loaded before set document.body && window.onload();