support multiple calls to cryptpad.ready

pull/1/head
ansuz 8 years ago
parent ec041c88e2
commit 4c0d7bf8e8

@ -1129,13 +1129,22 @@ define([
};
common.ready = function (f) {
var block = 0;
common.ready = (function () {
var env = {};
var initialized = false;
return function (f) {
if (initialized) {
return void window.setTimeout(function () {
f(void 0, env);
});
}
var block = 0;
var cb = function () {
block--;
if (!block) {
initialized = true;
f(void 0, env);
}
};
@ -1229,6 +1238,8 @@ define([
}, common);
};
}());
$(function () {
Messages._applyTranslation();
});

Loading…
Cancel
Save