Bug 21307: (follow-up) Change the way Codemirror height is calculated
authorOwen Leonard <oleonard@myacpl.org>
Tue, 5 Mar 2019 14:53:18 +0000 (14:53 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 19 Apr 2019 14:27:56 +0000 (14:27 +0000)
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 <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc

index 5bf7472..6c7f79f 100644 (file)
@@ -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() {