Fixed bug #14717: [Usability] Add delay to close the context menu
authorSteffen Kamper <info@sk-typo3.de>
Wed, 16 Jun 2010 22:13:38 +0000 (22:13 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 16 Jun 2010 22:13:38 +0000 (22:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7942 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/js/clickmenu.js

index 6720a57..96208d1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
 
 2010-06-16  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #14717: [Usability] Add delay to close the context menu
        * Fixed bug #14016: typo in class.t3lib_tcemain.php (Thanks to Vladimir Podkovanov)
 
 2010-06-15  Stanislas Rolland  <typo3@sjbr.ca>
index a2bd9d0..87d7206 100644 (file)
@@ -25,7 +25,7 @@ var Clickmenu = {
        clickURL: 'alt_clickmenu.php',  // URL to the clickmenu.php file, see template.php
        ajax: true,     // template.php -> isCMLayers check
        mousePos: { X: null, Y: null },
-
+       delayClickMenuHide: false,
 
        /**
         * main function, called from most clickmenu links
@@ -160,6 +160,8 @@ var Clickmenu = {
                        if (/MSIE5/.test(navigator.userAgent) && obj.id === 'contentMenu0') {
                                this._toggleSelectorBoxes('visible');
                        }
+               } else if (obj && Element.visible(obj)) {
+                       this.delayClickMenuHide = true;
                }
        },
 
@@ -170,7 +172,12 @@ var Clickmenu = {
         * @result      nothing
         */
        hide: function(obj) {
-               Element.hide(obj);
+               this.delayClickMenuHide = false;
+               window.setTimeout(function() {
+                       if (!Clickmenu.delayClickMenuHide) {
+                               Element.hide(obj);
+                       }
+               }, 500);
        },
 
        /**