Fixed bug #9810: ClearCacheMenu doesn't work when click on icon
authorSteffen Kamper <info@sk-typo3.de>
Tue, 23 Dec 2008 15:07:03 +0000 (15:07 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 23 Dec 2008 15:07:03 +0000 (15:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@4596 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/js/clearcachemenu.js

index cc09441..37e5333 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-23  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug #9810: ClearCacheMenu doesn't work when click on icon
+
 2008-12-22  Steffen Kamper  <info@sk-typo3.de>
 
        * Fixed bug #9977: Extensions class.ext_update.php scripts are executed even when extension isn't loaded
index 9ff3caf..b0e11e9 100644 (file)
@@ -105,21 +105,28 @@ var ClearCacheMenu = Class.create({
         */
        clearCache: function(event) {
                var toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item img')[0];
+               var url             = '';
+               var clickedElement  = Event.element(event);
+
+                       // activate the spinner
                toolbarItemIcon.src = 'gfx/spinner.gif';
 
-               if (event) {
-                       var url = Event.element(event).href;
-                       if (url) {
-                               new Ajax.Request(url, {
-                                       'method': 'get',
-                                       'onComplete': function() {
-                                               toolbarItemIcon.src = this.toolbarItemIcon;
-                                       }.bind(this)
-                               });
-                       }
-                       Event.stop(event);
+               if (clickedElement.tagName == 'IMG') {
+                       url =  clickedElement.up('a').href;
+               } else {
+                       url =  clickedElement.href;
+               }
+
+               if (url) {
+                       new Ajax.Request(url, {
+                               'method': 'get',
+                               'onComplete': function() {
+                                       toolbarItemIcon.src = this.toolbarItemIcon;
+                               }.bind(this)
+                       });
                }
-               this.toggleMenu();
+
+               this.toggleMenu(event);
        }
 });