From b038195735d2e9e64598cf12485aff3c4eeb1948 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 5 Mar 2019 14:53:18 +0000 Subject: [PATCH] Bug 21307: (follow-up) Change the way Codemirror height is calculated This follow-up changes the way the height of the Codemirror editor is calculated. Using offset() instead of position() returns the correct values with the changed markup. To test, apply the patch and load the advanced MARC editor. The "status bar" should display correctly a the bottom of the editor and there should be no double scrollbar. Signed-off-by: Michal Denar Signed-off-by: Michal Denar Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5bf7472f79..6c7f79f6dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -785,7 +785,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr if ( resizeTimer == null ) resizeTimer = setTimeout( function() { resizeTimer = null; - var pos = $('#editor .CodeMirror').position(); + var pos = $('#editor .CodeMirror').offset(); $('#editor .CodeMirror').height( $(window).height() - pos.top - 24 - $('#changelanguage').height() ); // 24 is hardcoded value but works well $('.modal-body').each( function() { -- 2.39.5