mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-13 18:45:43 +05:00
Fix issue introduced with b78ec996
This commit is contained in:
parent
b39b6dafee
commit
40415ce99b
@ -1559,15 +1559,12 @@ define([
|
||||
SecureModal.$iframe = $('<iframe>', {id: 'sbox-secure-iframe'}).appendTo($('body'));
|
||||
SecureModal.modal = SecureIframe.create(config);
|
||||
}
|
||||
setDocumentTitle();
|
||||
if (!cfg.hidden) {
|
||||
SecureModal.modal.refresh(cfg, function () {
|
||||
SecureModal.$iframe.show();
|
||||
setDocumentTitle();
|
||||
});
|
||||
} else {
|
||||
SecureModal.modal.refresh(cfg, function () {
|
||||
setDocumentTitle();
|
||||
});
|
||||
SecureModal.$iframe.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4,11 +4,12 @@ define([
|
||||
'/api/config',
|
||||
'jquery',
|
||||
'/common/requireconfig.js',
|
||||
'/common/common-util.js',
|
||||
'/customize/messages.js',
|
||||
], function (nThen, ApiConfig, $, RequireConfig, Messages) {
|
||||
], function (nThen, ApiConfig, $, RequireConfig, Util, Messages) {
|
||||
var requireConfig = RequireConfig();
|
||||
|
||||
var ready = false;
|
||||
var readyEvt = Util.mkEvent(true);
|
||||
|
||||
var create = function (config) {
|
||||
// Loaded in load #2
|
||||
@ -169,27 +170,20 @@ define([
|
||||
});
|
||||
|
||||
sframeChan.onReady(function () {
|
||||
if (ready === true) { return; }
|
||||
if (typeof ready === "function") {
|
||||
ready();
|
||||
}
|
||||
ready = true;
|
||||
readyEvt.fire();
|
||||
});
|
||||
});
|
||||
});
|
||||
var refresh = function (data, cb) {
|
||||
if (!ready) {
|
||||
ready = function () {
|
||||
refresh(data, cb);
|
||||
};
|
||||
return;
|
||||
}
|
||||
sframeChan.event('EV_REFRESH', data);
|
||||
cb();
|
||||
readyEvt.reg(() => {
|
||||
sframeChan.event('EV_REFRESH', data);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
var setTitle = function (title) {
|
||||
if (!sframeChan) { return; }
|
||||
sframeChan.event('EV_IFRAME_TITLE', title);
|
||||
readyEvt.reg(() => {
|
||||
sframeChan.event('EV_IFRAME_TITLE', title);
|
||||
});
|
||||
};
|
||||
return {
|
||||
refresh: refresh,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user