[BUGFIX] Reload list module on clickmenu action 31/25531/3
authorBernhard Kraft <kraft@webconsulting.at>
Wed, 20 Nov 2013 10:48:32 +0000 (11:48 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 20 Nov 2013 18:52:44 +0000 (19:52 +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/25531
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/backend/Resources/Public/JavaScript/clickmenu.js

index 7cf4b8c..aa3701a 100644 (file)
@@ -52,7 +52,7 @@ 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) {
@@ -63,13 +63,21 @@ var Clickmenu = {
                                parameters: params,
                                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];
                                        var data  = menu.getElementsByTagName('htmltable')[0].firstChild.data;
                                        var level = menu.getElementsByTagName('cmlevel')[0].firstChild.data;
                                        this.populateData(data, level);
+
                                }.bind(this)
                        });
                }