Fixed bug #16996: CSH tooltip shows for too long time (Thanks to Christian Mueller)
authorSteffen Gebert <steffen.gebert@typo3.org>
Fri, 14 Jan 2011 18:56:05 +0000 (18:56 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Fri, 14 Jan 2011 18:56:05 +0000 (18:56 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10074 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/contexthelp.js

index 3917d50..203e300 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2011-01-14  Christia Kuhn  <lolli@schwarzbu.ch>
+2011-01-14  Steffen Gebert  <steffen@steffen-gebert.de>
+
+       * Fixed bug #16996: CSH tooltip shows for too long time (Thanks to Christian Mueller)
+
+2011-01-14  Christian Kuhn  <lolli@schwarzbu.ch>
 
        * Fixed bug #17034: Live search also returns records which not available to the user (Thanks to Peter Beernink)
        * Follow-up to #17032: Remove early return
index f7a410c..5024ce7 100644 (file)
@@ -101,30 +101,67 @@ TYPO3.ContextHelp = function() {
                                cls: 'typo3-csh-tooltip',
                                shadow: false,
                                dismissDelay: 0, // tooltip stays while mouse is over target
+                               autoHide: true,
                                showDelay: 500, // show after 0.5 seconds
-                               hideDelay: 3000, // hide after 3 seconds
+                               hideDelay: 500, // hide after 3 seconds
                                closable: true,
+                               isMouseOver: false,
                                listeners: {
                                        beforeshow: showToolTipHelp,
                                        render: function(tip) {
-                                               tip.body.on('click', function(event){
-                                                       event.stopEvent();
-                                                       if (tip.moreInfo) {
-                                                               try {
-                                                                       top.TYPO3.ContextHelpWindow.open(tip.cshLink);
-                                                               } catch(e) {
-                                                                       // do nothing
+                                               tip.body.on({
+                                                       'click': {
+                                                               fn: function(event) {
+                                                                       event.stopEvent();
+                                                                       if (tip.moreInfo) {
+                                                                               try {
+                                                                                       top.TYPO3.ContextHelpWindow.open(tip.cshLink);
+                                                                               } catch(e) {
+                                                                                       // do nothing
+                                                                               }
+                                                                       }
+                                                                       tip.hide();
                                                                }
                                                        }
                                                });
+                                               tip.el.on({
+                                                       'mouseover': {
+                                                               fn: function() {
+                                                                       tip.isMouseOver = true;
+                                                               }
+                                                       },
+                                                       'mouseout': {
+                                                               fn: function() {
+                                                                       tip.isMouseOver = false;
+                                                                       tip.hide.defer(200, tip, []);
+                                                               }
+                                                       }
+                                               });             
                                        },
                                        hide: function(tip) {
                                                tip.setTitle('');
                                                tip.body.dom.innerHTML = '';
                                        },
+                                       beforehide: function(tip) {
+                                               return !tip.isMouseOver;
+                                       },
                                        scope: this
                                }
                        });
+
+                       Ext.getBody().on({
+                               'keydown': {
+                                       fn: function() {
+                                               tip.hide();
+                                       }
+                               },
+                               'click': {
+                                       fn: function() {
+                                               tip.hide();
+                                       }
+                               }
+                       });
+
                },