backoffice: adapt dialogs and ckeditor widths to match (#50214)

This commit is contained in:
Frédéric Péters 2021-01-17 16:01:16 +01:00
parent 11166dbecb
commit 309507987e
2 changed files with 10 additions and 3 deletions

View File

@ -4,8 +4,12 @@ function displayPopup(event)
url: $(this).attr('href'),
beforeSend: function(xhr) {xhr.setRequestHeader('X-Popup', 'true'); },
success: function(html) {
var title = $(html).find('h2').text();
var dialog = $(html).dialog({
var $html = $(html);
// force textarea width so the dialog is sized to properly embed
// the ckeditor widget.
$html.find('div.WysiwygTextWidget textarea').attr('cols', '80');
var title = $html.find('h2').text();
var dialog = $html.dialog({
closeText: WCS_I18N.close,
modal: true,
title: title,

View File

@ -18,6 +18,9 @@ $(document).ready( function() {
});
$(document).on('wcs:dialog-loaded', function(e, dialog) {
var $textarea = $(dialog).find('div.WysiwygTextWidget textarea');
$textarea.ckeditor($textarea.data('config'));
var config = $textarea.data('config');
config.width = $(dialog).width();
config.height = $textarea.height() + 100;
$textarea.ckeditor(config);
});
});