JS: move compute_max_height function to global scope (#53778)
gitea-wip/combo/pipeline/head Build started... Details
gitea/combo/pipeline/head Build started... Details

This commit is contained in:
Thomas Jund 2021-04-20 10:10:46 +02:00
parent 428033da0f
commit 5ea4db9d40
1 changed files with 10 additions and 10 deletions

View File

@ -190,6 +190,16 @@ function init_pages_list(toggle_state)
});
}
function compute_max_height($cell) {
var cell_id = $cell.attr('id');
$('style#for-' + cell_id).remove();
var h = $cell.find('h3 + div').height() + 40;
h += $cell.find('.multisort').length * 250;
h += $cell.find('.django-ckeditor-widget').length * 200;
var style = '<style id="for-' + cell_id + '">div#' + cell_id + '.toggled h3 + div { max-height: '+h+'px; }</style>';
$(style).appendTo('head');
}
$(function() {
$('div.cell-list h3').on('click', function() {
$(this).parent().toggleClass('toggled').toggleClass('untoggled');
@ -298,16 +308,6 @@ $(function() {
return false;
});
function compute_max_height($cell) {
var cell_id = $cell.attr('id');
$('style#for-' + cell_id).remove();
var h = $cell.find('h3 + div').height() + 40;
h += $cell.find('.multisort').length * 250;
h += $cell.find('.django-ckeditor-widget').length * 200;
var style = '<style id="for-' + cell_id + '">div#' + cell_id + '.toggled h3 + div { max-height: '+h+'px; }</style>';
$(style).appendTo('head');
}
function handle_tipi_form(element) {
var prefix_components = element.attr('name').split('-');
/* remove field name and keep only prefix */