Fixed bug #17163: CSH tooltips should be placed nearer to the text (Thanks to Stanisl...
authorErnesto Baschny <ernst@cron-it.de>
Thu, 20 Jan 2011 12:43:23 +0000 (12:43 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 20 Jan 2011 12:43:23 +0000 (12:43 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10156 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/contexthelp.js

index 1f4ad7a..996aff1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
 
 2011-01-20  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Fixed bug #17163: CSH tooltips should be placed nearer to the text (Thanks to Stanislas Rolland)
        * Fixed issue #17109: Make the t3lib_utility_Mail hook subscriber optional / configureable
 
 2011-01-20  Jeff Segars  <jeff@webempoweredchurch.org>
index 23f08ea..9594387 100644 (file)
@@ -96,6 +96,8 @@ TYPO3.ContextHelp = function() {
                                html: '',
                                        // The tooltip will appear above the label, if viewport allows
                                anchor: 'bottom',
+                                       // The anchor is pushed slightly to the left in order to align with the help icon of doc headers
+                               anchorOffset: -10,
                                minWidth: 160,
                                maxWidth: 240,
                                target: Ext.getBody(),
@@ -164,12 +166,24 @@ TYPO3.ContextHelp = function() {
                                        }
                                }
                        });
+                       
+                       /**
+                        * Adds a sequence to Ext.TooltTip::showAt so as to increase vertical offset when anchor position is 'botton'
+                        * This positions the tip box closer to the target element when the anchor is on the bottom side of the box
+                        *
+                        */
+                       Ext.ToolTip.prototype.showAt = Ext.ToolTip.prototype.showAt.createSequence(
+                               function() {
+                                       var ap = this.getAnchorPosition().charAt(0);
+                                       if (this.anchorToTarget && !this.trackMouse && ap == 'b') {
+                                               var xy = this.getPosition();
+                                               this.setPagePosition(xy[0], xy[1]+5);
+                                       }
+                               }
+                       );
 
                },
 
-
-
-
                /**
                 * Opens the help window, triggered from click event handler
                 *