support multiple calls to cryptpad.ready
This commit is contained in:
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…
x
Reference in New Issue
Block a user