From 9bee75e107178e4ca907cc3a8c7399f3a128fbe6 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 18 Oct 2022 20:53:03 +0000 Subject: [PATCH] Bug 31863: Account for changelanguage element when adjusting editor height To test: 1. Turn on 'EnableAdvancedCatalogingEditor' 2. Go to a record with enough MARC data that it should take up the entire width of your screen, 3. The CodeMirror editor will only be 300px. 4. Resize your screen, nothing happens to the editor height 5. Apply patch 6. Look at the same record in your editor, the editor should go to the bottom of the page now. Resizing your screen should resize the editor. 7. Have some additional language packs installed, and change the language system pref so the '#changelanguage' option will appear. 8. Make sure the editor height is still being properly set. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index 18cafecbb2..12a0de3d9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -1020,8 +1020,11 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr resizeTimer = null; var pos = $('#editor .CodeMirror').offset(); - $('#editor .CodeMirror').height( $(window).height() - pos.top - 24 - $('#changelanguage').height() ); // 24 is hardcoded value but works well - + if ( $('#changelanguage').length ) { + $('#editor .CodeMirror').height( $(window).height() - pos.top - 24 - $('#changelanguage').height() ); // 24 is hardcoded value but works well + } else { + $('#editor .CodeMirror').height( $(window).height() - pos.top - 24 ); + } $('.modal-body').each( function() { $(this).height( $(window).height() * .8 - $(this).prevAll('.modal-header').height() ); } ); -- 2.39.5