[BUGFIX] Reload list module on clickmenu action 43/25543/2
authorBernhard Kraft <kraft@webconsulting.at>
Wed, 20 Nov 2013 10:48:32 +0000 (11:48 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 24 Nov 2013 19:59:49 +0000 (20:59 +0100)
This solves the problem of a not refreshing list module
when the clickmenu of an element is used to copy/move the
element.

Releases: 6.2, 6.1, 6.0, 4.5
Resolves: #15958
Change-Id: I2eee6162636e0c78ed361c26f81ce2bfe8835283
Reviewed-on: https://review.typo3.org/25543
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/js/clickmenu.js

index 1f313ed..f1c1d8f 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 /**
- * new clickmenu code to make an AJAX call and render the 
+ * new clickmenu code to make an AJAX call and render the
  * AJAX result in a layer next to the mouse cursor
  */
 var Clickmenu = {
@@ -52,10 +52,10 @@ var Clickmenu = {
         * switch function that either makes an AJAX call
         * or loads the request in the top frame
         *
-        * @param       params  parameters added to the URL
+        * @param       params  parameters added to the URL
         * @return      nothing
-        */ 
-       callURL: function(params) {     
+        */
+       callURL: function(params) {
                if (this.ajax && Ajax.getTransport()) { // run with AJAX
                        params += '&ajax=1';
                        var call = new Ajax.Request(this.clickURL, {
@@ -64,6 +64,12 @@ var Clickmenu = {
                                onComplete: function(xhr) {
                                        var response = xhr.responseXML;
                                        if (!response.getElementsByTagName('data')[0]) {
+                                               var res = params.match(/&reloadListFrame=(0|1|2)(&|$)/);
+                                               var reloadListFrame = parseInt(res[1], 0);
+                                               if (reloadListFrame) {
+                                                       var doc = reloadListFrame != 2 ? top.content.list_frame : top.content;
+                                                       doc.location.reload(true);
+                                               }
                                                return;
                                        }
                                        var menu  = response.getElementsByTagName('data')[0].getElementsByTagName('clickmenu')[0];
@@ -254,7 +260,7 @@ function hideSpecific(level) {
        if (level === 0 || level === 1) {
                Clickmenu.hide('contentMenu'+level);
        }
-} 
+}
 function showHideSelectorBoxes(action) {
        toggleSelectorBoxes(action);
 }