[BUGFIX] Avoid RTE context menu collapse to arrows only 79/50779/3
authorClaus Due <claus@namelesscoder.net>
Fri, 25 Nov 2016 11:57:44 +0000 (12:57 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 1 Dec 2016 20:52:28 +0000 (21:52 +0100)
Solves an issue in Chrome where calculating the height of
the editor window returns zero. Solved by hardcoding a
minimum context menu height of 150 pixels; applied via
Math.max()'ing the resolved height and 150.

Change-Id: Ie79507d661128f6aff31c12573b9c020b913ec8a
Resolves: #78795
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/50779
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Gianluigi Martino <gmartino27@gmail.com>
Tested-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/ContextMenu.js

index d70f803..61772e6 100644 (file)
@@ -86,7 +86,9 @@ define([
                                var $me = $(this),
                                        $firstGroupItem = $me.parent().find('.list-group-item:first'),
                                        direction = $me.data('direction'),
-                                       itemHeight = $firstGroupItem.outerHeight(),
+                                       // itemHeight is guarded against becoming less than 150px tall by hardcoded boundary. Avoids case of
+                                       // zero-pixel height when calculating the editor document height fails.
+                                       itemHeight = Math.max($firstGroupItem.outerHeight(), 150),
                                        listGroup = $firstGroupItem.parent(),
                                        scrollTop = direction === 'down'
                                                ? listGroup.scrollTop() + itemHeight