JS: move compute_max_height function to global scope (#53778)
This commit is contained in:
parent
428033da0f
commit
5ea4db9d40
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue