From: Tymoteusz Motylewski Date: Fri, 29 Dec 2017 22:52:53 +0000 (+0100) Subject: [BUGFIX] Refresh page tree after context menu actions are completed X-Git-Tag: v8.7.10~56 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/17136ee9f2bfc29268b1676a56f96eb6d97b59aa?hp=8a5b320910b52208c0ba17ec1bfd8227d3481cd0;ds=sidebyside [BUGFIX] Refresh page tree after context menu actions are completed Instead of hardcoded 500ms delay, context menu actions refresh page tree as soon as the operation is completed. Releases: 8.7 Resolves: #82970 Change-Id: I697a35a6152bd7c58a4702ab1288ab55c32f9029 Reviewed-on: https://review.typo3.org/55233 Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez --- diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js b/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js index dd9b962a3a57..a10da29cd50b 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js @@ -98,15 +98,17 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func ContextMenuActions.disableRecord = function (table, uid) { top.TYPO3.Backend.ContentContainer.setUrl( top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=1&prErr=1&redirect=' + ContextMenuActions.getReturnUrl() - ); - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500); + ).on('load', function () { + top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); + }); }; ContextMenuActions.enableRecord = function (table, uid) { top.TYPO3.Backend.ContentContainer.setUrl( top.TYPO3.settings.RecordCommit.moduleUrl + '&data[' + table + '][' + uid + '][hidden]=0&prErr=1&redirect=' + ContextMenuActions.getReturnUrl() - ); - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500); + ).on('load', function () { + top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); + }); }; ContextMenuActions.deleteRecord = function (table, uid) { @@ -132,10 +134,11 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func if (e.target.name === 'delete') { top.TYPO3.Backend.ContentContainer.setUrl( top.TYPO3.settings.RecordCommit.moduleUrl + '&redirect=' + ContextMenuActions.getReturnUrl() + '&cmd[' + table + '][' + uid + '][delete]=1&prErr=1' - ); - if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500); - } + ).on('load', function () { + if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { + top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); + } + }); } Modal.dismiss(); }); @@ -203,10 +206,11 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func top.TYPO3.Backend.ContentContainer.setUrl( top.TYPO3.settings.RecordCommit.moduleUrl + url - ); - if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { - top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree.defer(500); - } + ).on('load', function () { + if (table === 'pages' && top.TYPO3.Backend.NavigationContainer.PageTree) { + top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree(); + } + }); }; if (!$anchorElement.data('title')) { performPaste(); @@ -239,4 +243,4 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func }; return ContextMenuActions; -}); \ No newline at end of file +}); diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Viewport.js b/typo3/sysext/backend/Resources/Public/JavaScript/Viewport.js index 8b68224db2d0..e68202b47da4 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Viewport.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Viewport.js @@ -130,7 +130,7 @@ define( }, setUrl: function (urlToLoad) { TYPO3.Backend.Loader.start(); - $('.t3js-scaffold-content-module-iframe') + return $('.t3js-scaffold-content-module-iframe') .attr('src', urlToLoad) .one('load', function() { TYPO3.Backend.Loader.finish();