Fix race condition preventing slide to work on Edge

pull/1/head
yflory 7 years ago
parent f2aaaa9751
commit 290d668ceb

@ -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);

@ -313,6 +313,8 @@ define([
Cryptpad.useTemplate(href, Cryptget, cb);
});
sframeChan.ready();
CpNfOuter.start({
sframeChan: sframeChan,
channel: secret.channel,

@ -228,6 +228,7 @@ define([
Cryptpad.log(data.logText);
});
ctx.sframeChan.ready();
cb(funcs);
});
} };

Loading…
Cancel
Save