Projet

Général

Profil

0001-JS-move-compute_max_height-function-to-global-scope-.patch

Thomas Jund, 05 mai 2021 16:16

Télécharger (1,83 ko)

Voir les différences:

Subject: [PATCH] JS: move compute_max_height function to global scope (#53778)

 combo/manager/static/js/combo.manager.js | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
combo/manager/static/js/combo.manager.js
190 190
  });
191 191
}
192 192

  
193
function compute_max_height($cell) {
194
  var cell_id = $cell.attr('id');
195
  $('style#for-' + cell_id).remove();
196
  var h = $cell.find('h3 + div').height() + 40;
197
  h += $cell.find('.multisort').length * 250;
198
  h += $cell.find('.django-ckeditor-widget').length * 200;
199
  var style = '<style id="for-' + cell_id + '">div#' + cell_id + '.toggled h3 + div { max-height: '+h+'px; }</style>';
200
  $(style).appendTo('head');
201
}
202

  
193 203
$(function() {
194 204
  $('div.cell-list h3').on('click', function() {
195 205
    $(this).parent().toggleClass('toggled').toggleClass('untoggled');
......
298 308
     return false;
299 309
  });
300 310

  
301
  function compute_max_height($cell) {
302
    var cell_id = $cell.attr('id');
303
    $('style#for-' + cell_id).remove();
304
    var h = $cell.find('h3 + div').height() + 40;
305
    h += $cell.find('.multisort').length * 250;
306
    h += $cell.find('.django-ckeditor-widget').length * 200;
307
    var style = '<style id="for-' + cell_id + '">div#' + cell_id + '.toggled h3 + div { max-height: '+h+'px; }</style>';
308
    $(style).appendTo('head');
309
  }
310

  
311 311
  function handle_tipi_form(element) {
312 312
    var prefix_components = element.attr('name').split('-');
313 313
    /* remove field name and keep only prefix */
314
-