[BUGFIX] Avoid re-paints and re-layouts in page tree on drag&drop
When using drag&drop in the page tree, many style changes happen: * a shadow node is rendered that is moved around * the content within the shadow node changes depending on whether dropping is allowed * CSS classes are changed The previous implementation was not optimal in several ways: * the nodes wrapper (aka the "tree") was updated twice which each `dragover` event, being expensive on huge trees * adding and removing CSS classes may have become redundant in some cases, triggering a re-paint every time All these cases are handled in this patch by executing tasks only when absolutely necessary. Resolves: #99786 Releases: main, 11.5 Change-Id: Ibc8cbce2785e2de646e254590b4eddbdc42839c1 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77658 Tested-by:Benni Mack <benni@typo3.org> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech>
Showing
- Build/Sources/TypeScript/backend/page-tree/page-tree-element.ts 3 additions, 2 deletions...Sources/TypeScript/backend/page-tree/page-tree-element.ts
- Build/Sources/TypeScript/backend/tree/drag-drop.ts 11 additions, 22 deletionsBuild/Sources/TypeScript/backend/tree/drag-drop.ts
- Build/Sources/TypeScript/backend/tree/file-storage-tree-container.ts 0 additions, 4 deletions...es/TypeScript/backend/tree/file-storage-tree-container.ts
- typo3/sysext/backend/Resources/Public/JavaScript/page-tree/page-tree-element.js 1 addition, 1 deletion...esources/Public/JavaScript/page-tree/page-tree-element.js
- typo3/sysext/backend/Resources/Public/JavaScript/tree/drag-drop.js 1 addition, 1 deletion...ext/backend/Resources/Public/JavaScript/tree/drag-drop.js
- typo3/sysext/backend/Resources/Public/JavaScript/tree/file-storage-tree-container.js 1 addition, 1 deletion...ces/Public/JavaScript/tree/file-storage-tree-container.js
Please register or sign in to comment