Fix race condition preventing slide to work on Edge

This commit is contained in:
yflory
2017-09-08 15:53:53 +02:00
parent f2aaaa9751
commit 290d668ceb
3 changed files with 18 additions and 0 deletions

View File

@@ -105,6 +105,21 @@ define([
insideHandlers.push(content);
}, true);
// Make sure both iframes are ready
var readyHandlers = [];
chan.onReady = function (h) {
if (typeof(h) !== "function") { return; }
readyHandlers.push(h);
};
chan.ready = function () {
chan.whenReg('EV_RPC_READY', function () {
chan.event('EV_RPC_READY');
});
chan.on('EV_RPC_READY', function () {
readyHandlers.forEach(function (h) { h(); });
});
};
var txid;
window.addEventListener('message', function (msg) {
var data = JSON.parse(msg.data);