[BUGFIX] t3editor: Fix scrolling by cursor 29/41829/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 22 Jul 2015 16:13:08 +0000 (18:13 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 22 Jul 2015 16:37:01 +0000 (18:37 +0200)
Fix some non-jQuery DOM manipulations and change height
calculation to make scrolling by cursor working again.

Resolves: #68442
Releases: master
Change-Id: Ifcac7b25ee8a11797e5cc5c2639c9987c9a5efd2
Reviewed-on: http://review.typo3.org/41829
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/t3editor/Resources/Public/JavaScript/Plugins/CodeCompletion/TsCodeCompletion.js

index 737650d..65995c2 100644 (file)
@@ -414,7 +414,7 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsCodeCompletion', [
                        // init styles
                        TsCodeCompletion.$codeCompleteBox.css({
                                overflow: 'scroll',
-                               height: (TsCodeCompletion.options.ccWords * $('#cc_word_0').height()) + 'px'
+                               height: ((TsCodeCompletion.options.ccWords + 1) * $('#cc_word_0').height()) + 'px'
                        });
 
                        var wrapOffset = $('.t3e_iframe_wrap', document).offset(),
@@ -484,7 +484,7 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsCodeCompletion', [
                                TsCodeCompletion.cc_down = TsCodeCompletion.proposals.length - 1;
                                TsCodeCompletion.cc_up = TsCodeCompletion.cc_down - (TsCodeCompletion.options.ccWords - 1);
                        }
-                       TsCodeCompletion.$codeCompleteBox.scrollTop = TsCodeCompletion.cc_up * 16;
+                       TsCodeCompletion.$codeCompleteBox.scrollTop(TsCodeCompletion.cc_up * 18);
                }
        };
 
@@ -510,7 +510,7 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsCodeCompletion', [
                                TsCodeCompletion.cc_up = 0;
                                TsCodeCompletion.cc_down = TsCodeCompletion.options.ccWords - 1;
                        }
-                       TsCodeCompletion.$codeCompleteBox.scrollTop = TsCodeCompletion.cc_up * 16;
+                       TsCodeCompletion.$codeCompleteBox.scrollTop(TsCodeCompletion.cc_up * 18);
                }
        };