From a989b51d744e71895df2e9bd23b8aa8db09f1dd4 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 5 Oct 2016 16:04:21 +0200 Subject: [PATCH] Fix race conditions with Alertify --- www/common/cryptpad-common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index addf3cd0c..888ee5e31 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -558,6 +558,9 @@ define([ common.store = env.store = store; $(function() { + // Race condition : if document.body is undefined when alertify.js is loaded, Alertify + // won't work. We have to reset it now to make sure it uses a correct "body" + Alertify.reset(); if($('#pad-iframe').length) { var $iframe = $('#pad-iframe'); var iframe = $iframe[0];