Projet

Général

Profil

0001-backoffice-adapt-dialogs-and-ckeditor-widths-to-matc.patch

Frédéric Péters, 17 janvier 2021 16:01

Télécharger (1,92 ko)

Voir les différences:

Subject: [PATCH] backoffice: adapt dialogs and ckeditor widths to match
 (#50214)

 wcs/qommon/static/js/popup.js          | 8 ++++++--
 wcs/qommon/static/js/qommon.wysiwyg.js | 5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
wcs/qommon/static/js/popup.js
4 4
        url: $(this).attr('href'),
5 5
        beforeSend: function(xhr) {xhr.setRequestHeader('X-Popup', 'true'); },
6 6
        success: function(html) {
7
            var title = $(html).find('h2').text();
8
            var dialog = $(html).dialog({
7
            var $html = $(html);
8
            // force textarea width so the dialog is sized to properly embed
9
            // the ckeditor widget.
10
            $html.find('div.WysiwygTextWidget textarea').attr('cols', '80');
11
            var title = $html.find('h2').text();
12
            var dialog = $html.dialog({
9 13
                closeText: WCS_I18N.close,
10 14
                modal: true,
11 15
                title: title,
wcs/qommon/static/js/qommon.wysiwyg.js
18 18
  });
19 19
  $(document).on('wcs:dialog-loaded', function(e, dialog) {
20 20
    var $textarea = $(dialog).find('div.WysiwygTextWidget textarea');
21
    $textarea.ckeditor($textarea.data('config'));
21
    var config = $textarea.data('config');
22
    config.width = $(dialog).width();
23
    config.height = $textarea.height() + 100;
24
    $textarea.ckeditor(config);
22 25
  });
23 26
});
24
-