backoffice: adapt dialogs and ckeditor widths to match (#50214)
This commit is contained in:
parent
11166dbecb
commit
309507987e
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue