make sure that /pad is resized after loading

pull/1/head
ansuz 8 years ago
parent 0abec4ddb3
commit 1c3f1a15cd

@ -678,8 +678,8 @@ define([
$loading.append($container);
$('body').append($loading);
};
common.removeLoadingScreen = function () {
$('#' + LOADING).fadeOut(750);
common.removeLoadingScreen = function (cb) {
$('#' + LOADING).fadeOut(750, cb);
};
common.errorLoadingScreen = function (error) {
$('.spinnerContainer').hide();

@ -62,6 +62,14 @@ define([
Cryptpad: Cryptpad,
};
var emitResize = APP.emitResize = function () {
var cw = $('#pad-iframe')[0].contentWindow;
var evt = cw.document.createEvent('UIEvents');
evt.initUIEvent('resize', true, false, cw, 0);
cw.dispatchEvent(evt);
};
var toolbar;
var isNotMagicLine = function (el) {
@ -630,11 +638,6 @@ define([
if (!APP.isMaximized) {
editor.execCommand('maximize');
APP.isMaximized = true;
// We have to call it 3 times in Safari in order to have the editor fully maximized -_-
if ((''+window.navigator.vendor).indexOf('Apple') !== -1) {
editor.execCommand('maximize');
editor.execCommand('maximize');
}
}
module.patchText = TextPatcher.create({
@ -661,7 +664,8 @@ define([
console.log("Unlocking editor");
setEditable(true);
initializing = false;
Cryptpad.removeLoadingScreen();
Cryptpad.removeLoadingScreen(emitResize);
// Update the toolbar list:
// Add the current user in the metadata if he has edit rights
if (readOnly) { return; }

Loading…
Cancel
Save