From 6ca03c0c5b52ca66e5b226036064d303217ee1fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech>
Date: Sat, 14 Aug 2021 21:48:43 +0200
Subject: [PATCH] [BUGFIX] Always remove deletedDropZone in PageTree after
 dragEnd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If the dropzone was not visible, remove it without animation.

Resolves: #94892
Releases: master
Change-Id: Icfb0090b9383321cd1d24c0aba7026affdbb58d9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70594
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack <benni@typo3.org>
---
 .../Resources/Public/TypeScript/PageTree/PageTreeElement.ts    | 3 +++
 .../Resources/Public/JavaScript/PageTree/PageTreeElement.js    | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/PageTree/PageTreeElement.ts b/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/PageTree/PageTreeElement.ts
index 4bc71afb2ffe..5da6f3bcca07 100644
--- a/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/PageTree/PageTreeElement.ts
+++ b/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/PageTree/PageTreeElement.ts
@@ -915,6 +915,9 @@ class PageTreeNodeDragHandler implements DragDropHandler {
         dropZone.remove();
         this.dropZoneDelete = null;
       });
+    } else if (this.dropZoneDelete && this.dropZoneDelete.node().dataset.open === 'false') {
+      this.dropZoneDelete.remove();
+      this.dropZoneDelete = null;
     } else {
       this.dropZoneDelete = null;
     }
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
index f1109b27d945..db2f01f5aaca 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/PageTree/PageTreeElement.js
@@ -54,4 +54,4 @@ var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,o)
               `):""}
         </div>
       </div>
-    `}dragToolbar(e,t){return t.connectDragHandler(new P(e,this.tree,t))}};__decorate([o.property({type:f})],y.prototype,"tree",void 0),y=__decorate([o.customElement("typo3-backend-navigation-component-pagetree-toolbar")],y);class b extends g.DragDrop{changeNodePosition(e,t=""){const i=this.tree.nodes,o=this.tree.settings.nodeDrag.identifier;let n=this.tree.settings.nodeDragPosition,s=e||this.tree.settings.nodeDrag;if(o===s.identifier&&"delete"!==t)return null;if(n===g.DraggablePositionEnum.BEFORE){const t=i.indexOf(e),o=this.setNodePositionAndTarget(t);if(null===o)return null;n=o.position,s=o.target}return{node:this.tree.settings.nodeDrag,uid:o,target:s,position:n,command:t}}setNodePositionAndTarget(e){const t=this.tree.nodes,i=t[e].depth;e>0&&e--;const o=t[e].depth,n=this.tree.nodes[e];if(o===i)return{position:g.DraggablePositionEnum.AFTER,target:n};if(o<i)return{position:g.DraggablePositionEnum.INSIDE,target:n};for(let o=e;o>=0;o--){if(t[o].depth===i)return{position:g.DraggablePositionEnum.AFTER,target:this.tree.nodes[o]};if(t[o].depth<i)return{position:g.DraggablePositionEnum.AFTER,target:t[o]}}return null}}class P{constructor(e,t,i){this.startDrag=!1,this.startPageX=0,this.startPageY=0,this.id="",this.name="",this.tooltip="",this.icon="",this.isDragged=!1,this.id=e.nodeType,this.name=e.title,this.tooltip=e.tooltip,this.icon=e.icon,this.tree=t,this.dragDrop=i}dragStart(e){return this.isDragged=!1,this.startDrag=!1,this.startPageX=e.sourceEvent.pageX,this.startPageY=e.sourceEvent.pageY,!0}dragDragged(e){return!!this.dragDrop.isDragNodeDistanceMore(e,this)&&(this.startDrag=!0,!1===this.isDragged&&(this.isDragged=!0,this.dragDrop.createDraggable("#icon-"+this.icon,this.name)),this.dragDrop.openNodeTimeout(),this.dragDrop.updateDraggablePosition(e),this.dragDrop.changeNodeClasses(e),!0)}dragEnd(e){return!!this.startDrag&&(this.isDragged=!1,this.dragDrop.removeNodeDdClass(),!(!0!==this.tree.settings.allowDragMove||!this.tree.hoveredNode||!this.tree.isOverSvg)&&(this.tree.settings.canNodeDrag&&this.addNewNode({type:this.id,name:this.name,tooltip:this.tooltip,icon:this.icon,position:this.tree.settings.nodeDragPosition,target:this.tree.hoveredNode}),!0))}addNewNode(e){const t=e.target;let i=this.tree.nodes.indexOf(t);const o={command:"new"};if(o.type=e.type,o.identifier="-1",o.target=t,o.parents=t.parents,o.parentsStateIdentifier=t.parentsStateIdentifier,o.depth=t.depth,o.position=e.position,o.name=void 0!==e.title?e.title:TYPO3.lang["tree.defaultPageTitle"],o.y=o.y||o.target.y,o.x=o.x||o.target.x,this.tree.nodeIsEdit=!0,e.position===g.DraggablePositionEnum.INSIDE&&(o.depth++,o.parents.unshift(i),o.parentsStateIdentifier.unshift(this.tree.nodes[i].stateIdentifier),this.tree.nodes[i].hasChildren=!0,this.tree.showChildren(this.tree.nodes[i])),e.position!==g.DraggablePositionEnum.INSIDE&&e.position!==g.DraggablePositionEnum.AFTER||i++,e.icon&&(o.icon=e.icon),o.position===g.DraggablePositionEnum.BEFORE){const e=this.dragDrop.setNodePositionAndTarget(i);null!==e&&(o.position=e.position,o.target=e.target)}this.tree.nodes.splice(i,0,o),this.tree.setParametersNode(),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes(),this.tree.removeEditedText(),h.select(this.tree.svg.node().parentNode).append("input").attr("class","node-edit").style("top",o.y+this.tree.settings.marginTop+"px").style("left",o.x+this.tree.textPosition+5+"px").style("width",this.tree.settings.width-(o.x+this.tree.textPosition+20)+"px").style("height",this.tree.settings.nodeHeight+"px").attr("text","text").attr("value",o.name).on("keydown",e=>{const t=e.target,i=e.keyCode;if(13===i||9===i){this.tree.nodeIsEdit=!1;const e=t.value.trim();e.length?(o.name=e,this.tree.removeEditedText(),this.tree.sendChangeCommand(o)):this.removeNode(o)}else 27===i&&(this.tree.nodeIsEdit=!1,this.removeNode(o))}).on("blur",e=>{if(this.tree.nodeIsEdit&&this.tree.nodes.indexOf(o)>-1){const t=e.target.value.trim();t.length?(o.name=t,this.tree.removeEditedText(),this.tree.sendChangeCommand(o)):this.removeNode(o)}}).node().select()}removeNode(e){let t=this.tree.nodes.indexOf(e);this.tree.nodes[t-1].depth==e.depth||this.tree.nodes[t+1]&&this.tree.nodes[t+1].depth==e.depth||(this.tree.nodes[t-1].hasChildren=!1),this.tree.nodes.splice(t,1),this.tree.setParametersNode(),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes(),this.tree.removeEditedText()}}class N{constructor(e,t){this.startDrag=!1,this.startPageX=0,this.startPageY=0,this.isDragged=!1,this.nodeIsOverDelete=!1,this.tree=e,this.dragDrop=t}dragStart(e){const t=e.subject;return!0===this.tree.settings.allowDragMove&&0!==t.depth&&(this.dropZoneDelete=null,t.allowDelete&&(this.dropZoneDelete=this.tree.nodesContainer.select('.node[data-state-id="'+t.stateIdentifier+'"]').append("g").attr("class","nodes-drop-zone").attr("height",this.tree.settings.nodeHeight),this.nodeIsOverDelete=!1,this.dropZoneDelete.append("rect").attr("height",this.tree.settings.nodeHeight).attr("width","50px").attr("x",0).attr("y",0).on("mouseover",()=>{this.nodeIsOverDelete=!0}).on("mouseout",()=>{this.nodeIsOverDelete=!1}),this.dropZoneDelete.append("text").text(TYPO3.lang.deleteItem).attr("dx",5).attr("dy",15),this.dropZoneDelete.node().dataset.open="false",this.dropZoneDelete.node().style.transform=this.getDropZoneCloseTransform(t)),this.startPageX=e.sourceEvent.pageX,this.startPageY=e.sourceEvent.pageY,this.startDrag=!1,!0)}dragDragged(e){const t=e.subject;if(!this.dragDrop.isDragNodeDistanceMore(e,this))return!1;if(this.startDrag=!0,!0!==this.tree.settings.allowDragMove||0===t.depth)return!1;this.tree.settings.nodeDrag=t;const i=this.tree.svg.node().querySelector('.node-bg[data-state-id="'+t.stateIdentifier+'"]'),o=this.tree.svg.node().parentNode.querySelector(".node-dd");return this.isDragged||(this.isDragged=!0,this.dragDrop.createDraggable(this.tree.getIconId(t),t.name),i.classList.add("node-bg--dragging")),this.tree.settings.nodeDragPosition=!1,this.dragDrop.openNodeTimeout(),this.dragDrop.updateDraggablePosition(e),t.isOver||this.tree.hoveredNode&&-1!==this.tree.hoveredNode.parentsStateIdentifier.indexOf(t.stateIdentifier)||!this.tree.isOverSvg?(this.dragDrop.addNodeDdClass(o,"nodrop"),this.tree.isOverSvg||this.tree.nodesBgContainer.selectAll(".node-bg__border").style("display","none"),this.dropZoneDelete&&"true"!==this.dropZoneDelete.node().dataset.open&&this.tree.isOverSvg&&this.animateDropZone("show",this.dropZoneDelete.node(),t)):this.tree.hoveredNode?this.dropZoneDelete&&"false"!==this.dropZoneDelete.node().dataset.open&&this.animateDropZone("hide",this.dropZoneDelete.node(),t):(this.dragDrop.addNodeDdClass(o,"nodrop"),this.tree.nodesBgContainer.selectAll(".node-bg__border").style("display","none")),this.dragDrop.changeNodeClasses(e),!0}dragEnd(e){const t=e.subject;if(this.dropZoneDelete&&"true"===this.dropZoneDelete.node().dataset.open){const e=this.dropZoneDelete;this.animateDropZone("hide",this.dropZoneDelete.node(),t,()=>{e.remove(),this.dropZoneDelete=null})}else this.dropZoneDelete=null;if(!this.startDrag||!0!==this.tree.settings.allowDragMove||0===t.depth)return!1;const i=this.tree.hoveredNode;if(this.isDragged=!1,this.dragDrop.removeNodeDdClass(),t.isOver||i&&-1!==i.parentsStateIdentifier.indexOf(t.stateIdentifier)||!this.tree.settings.canNodeDrag||!this.tree.isOverSvg){if(this.nodeIsOverDelete){const e=this.dragDrop.changeNodePosition(i,"delete");if(null===e)return!1;if(this.tree.settings.displayDeleteConfirmation){u.confirm(TYPO3.lang.deleteItem,TYPO3.lang["mess.delete"].replace("%s",e.node.name),m.warning,[{text:TYPO3.lang["labels.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:TYPO3.lang["cm.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",t=>{"delete"===t.target.name&&this.tree.sendChangeCommand(e),u.dismiss()})}else this.tree.sendChangeCommand(e)}}else{const e=this.dragDrop.changeNodePosition(i,"");if(null===e)return!1;let t=e.position===g.DraggablePositionEnum.INSIDE?TYPO3.lang["mess.move_into"]:TYPO3.lang["mess.move_after"];t=t.replace("%s",e.node.name).replace("%s",e.target.name),u.confirm(TYPO3.lang.move_page,t,m.warning,[{text:TYPO3.lang["labels.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:TYPO3.lang["cm.copy"]||"Copy",btnClass:"btn-warning",name:"copy"},{text:TYPO3.lang["labels.move"]||"Move",btnClass:"btn-warning",name:"move"}]).on("button.clicked",t=>{const i=t.target;"move"===i.name?(e.command="move",this.tree.sendChangeCommand(e)):"copy"===i.name&&(e.command="copy",this.tree.sendChangeCommand(e)),u.dismiss()})}return!0}getDropZoneOpenTransform(e){return"translate("+((parseFloat(this.tree.svg.style("width"))||300)-58-e.x)+"px, -10px)"}getDropZoneCloseTransform(e){return"translate("+((parseFloat(this.tree.svg.style("width"))||300)-e.x)+"px, -10px)"}animateDropZone(e,t,i,o=null){t.classList.add("animating"),t.dataset.open="show"===e?"true":"false";let n=[{transform:this.getDropZoneCloseTransform(i)},{transform:this.getDropZoneOpenTransform(i)}];"show"!==e&&(n=n.reverse());const s=function(){t.style.transform=n[1].transform,t.classList.remove("animating"),o&&o()};"animate"in t?t.animate(n,{duration:300,easing:"cubic-bezier(.02, .01, .47, 1)"}).onfinish=s:s()}}}));
\ No newline at end of file
+    `}dragToolbar(e,t){return t.connectDragHandler(new P(e,this.tree,t))}};__decorate([o.property({type:f})],y.prototype,"tree",void 0),y=__decorate([o.customElement("typo3-backend-navigation-component-pagetree-toolbar")],y);class b extends g.DragDrop{changeNodePosition(e,t=""){const i=this.tree.nodes,o=this.tree.settings.nodeDrag.identifier;let n=this.tree.settings.nodeDragPosition,s=e||this.tree.settings.nodeDrag;if(o===s.identifier&&"delete"!==t)return null;if(n===g.DraggablePositionEnum.BEFORE){const t=i.indexOf(e),o=this.setNodePositionAndTarget(t);if(null===o)return null;n=o.position,s=o.target}return{node:this.tree.settings.nodeDrag,uid:o,target:s,position:n,command:t}}setNodePositionAndTarget(e){const t=this.tree.nodes,i=t[e].depth;e>0&&e--;const o=t[e].depth,n=this.tree.nodes[e];if(o===i)return{position:g.DraggablePositionEnum.AFTER,target:n};if(o<i)return{position:g.DraggablePositionEnum.INSIDE,target:n};for(let o=e;o>=0;o--){if(t[o].depth===i)return{position:g.DraggablePositionEnum.AFTER,target:this.tree.nodes[o]};if(t[o].depth<i)return{position:g.DraggablePositionEnum.AFTER,target:t[o]}}return null}}class P{constructor(e,t,i){this.startDrag=!1,this.startPageX=0,this.startPageY=0,this.id="",this.name="",this.tooltip="",this.icon="",this.isDragged=!1,this.id=e.nodeType,this.name=e.title,this.tooltip=e.tooltip,this.icon=e.icon,this.tree=t,this.dragDrop=i}dragStart(e){return this.isDragged=!1,this.startDrag=!1,this.startPageX=e.sourceEvent.pageX,this.startPageY=e.sourceEvent.pageY,!0}dragDragged(e){return!!this.dragDrop.isDragNodeDistanceMore(e,this)&&(this.startDrag=!0,!1===this.isDragged&&(this.isDragged=!0,this.dragDrop.createDraggable("#icon-"+this.icon,this.name)),this.dragDrop.openNodeTimeout(),this.dragDrop.updateDraggablePosition(e),this.dragDrop.changeNodeClasses(e),!0)}dragEnd(e){return!!this.startDrag&&(this.isDragged=!1,this.dragDrop.removeNodeDdClass(),!(!0!==this.tree.settings.allowDragMove||!this.tree.hoveredNode||!this.tree.isOverSvg)&&(this.tree.settings.canNodeDrag&&this.addNewNode({type:this.id,name:this.name,tooltip:this.tooltip,icon:this.icon,position:this.tree.settings.nodeDragPosition,target:this.tree.hoveredNode}),!0))}addNewNode(e){const t=e.target;let i=this.tree.nodes.indexOf(t);const o={command:"new"};if(o.type=e.type,o.identifier="-1",o.target=t,o.parents=t.parents,o.parentsStateIdentifier=t.parentsStateIdentifier,o.depth=t.depth,o.position=e.position,o.name=void 0!==e.title?e.title:TYPO3.lang["tree.defaultPageTitle"],o.y=o.y||o.target.y,o.x=o.x||o.target.x,this.tree.nodeIsEdit=!0,e.position===g.DraggablePositionEnum.INSIDE&&(o.depth++,o.parents.unshift(i),o.parentsStateIdentifier.unshift(this.tree.nodes[i].stateIdentifier),this.tree.nodes[i].hasChildren=!0,this.tree.showChildren(this.tree.nodes[i])),e.position!==g.DraggablePositionEnum.INSIDE&&e.position!==g.DraggablePositionEnum.AFTER||i++,e.icon&&(o.icon=e.icon),o.position===g.DraggablePositionEnum.BEFORE){const e=this.dragDrop.setNodePositionAndTarget(i);null!==e&&(o.position=e.position,o.target=e.target)}this.tree.nodes.splice(i,0,o),this.tree.setParametersNode(),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes(),this.tree.removeEditedText(),h.select(this.tree.svg.node().parentNode).append("input").attr("class","node-edit").style("top",o.y+this.tree.settings.marginTop+"px").style("left",o.x+this.tree.textPosition+5+"px").style("width",this.tree.settings.width-(o.x+this.tree.textPosition+20)+"px").style("height",this.tree.settings.nodeHeight+"px").attr("text","text").attr("value",o.name).on("keydown",e=>{const t=e.target,i=e.keyCode;if(13===i||9===i){this.tree.nodeIsEdit=!1;const e=t.value.trim();e.length?(o.name=e,this.tree.removeEditedText(),this.tree.sendChangeCommand(o)):this.removeNode(o)}else 27===i&&(this.tree.nodeIsEdit=!1,this.removeNode(o))}).on("blur",e=>{if(this.tree.nodeIsEdit&&this.tree.nodes.indexOf(o)>-1){const t=e.target.value.trim();t.length?(o.name=t,this.tree.removeEditedText(),this.tree.sendChangeCommand(o)):this.removeNode(o)}}).node().select()}removeNode(e){let t=this.tree.nodes.indexOf(e);this.tree.nodes[t-1].depth==e.depth||this.tree.nodes[t+1]&&this.tree.nodes[t+1].depth==e.depth||(this.tree.nodes[t-1].hasChildren=!1),this.tree.nodes.splice(t,1),this.tree.setParametersNode(),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes(),this.tree.removeEditedText()}}class N{constructor(e,t){this.startDrag=!1,this.startPageX=0,this.startPageY=0,this.isDragged=!1,this.nodeIsOverDelete=!1,this.tree=e,this.dragDrop=t}dragStart(e){const t=e.subject;return!0===this.tree.settings.allowDragMove&&0!==t.depth&&(this.dropZoneDelete=null,t.allowDelete&&(this.dropZoneDelete=this.tree.nodesContainer.select('.node[data-state-id="'+t.stateIdentifier+'"]').append("g").attr("class","nodes-drop-zone").attr("height",this.tree.settings.nodeHeight),this.nodeIsOverDelete=!1,this.dropZoneDelete.append("rect").attr("height",this.tree.settings.nodeHeight).attr("width","50px").attr("x",0).attr("y",0).on("mouseover",()=>{this.nodeIsOverDelete=!0}).on("mouseout",()=>{this.nodeIsOverDelete=!1}),this.dropZoneDelete.append("text").text(TYPO3.lang.deleteItem).attr("dx",5).attr("dy",15),this.dropZoneDelete.node().dataset.open="false",this.dropZoneDelete.node().style.transform=this.getDropZoneCloseTransform(t)),this.startPageX=e.sourceEvent.pageX,this.startPageY=e.sourceEvent.pageY,this.startDrag=!1,!0)}dragDragged(e){const t=e.subject;if(!this.dragDrop.isDragNodeDistanceMore(e,this))return!1;if(this.startDrag=!0,!0!==this.tree.settings.allowDragMove||0===t.depth)return!1;this.tree.settings.nodeDrag=t;const i=this.tree.svg.node().querySelector('.node-bg[data-state-id="'+t.stateIdentifier+'"]'),o=this.tree.svg.node().parentNode.querySelector(".node-dd");return this.isDragged||(this.isDragged=!0,this.dragDrop.createDraggable(this.tree.getIconId(t),t.name),i.classList.add("node-bg--dragging")),this.tree.settings.nodeDragPosition=!1,this.dragDrop.openNodeTimeout(),this.dragDrop.updateDraggablePosition(e),t.isOver||this.tree.hoveredNode&&-1!==this.tree.hoveredNode.parentsStateIdentifier.indexOf(t.stateIdentifier)||!this.tree.isOverSvg?(this.dragDrop.addNodeDdClass(o,"nodrop"),this.tree.isOverSvg||this.tree.nodesBgContainer.selectAll(".node-bg__border").style("display","none"),this.dropZoneDelete&&"true"!==this.dropZoneDelete.node().dataset.open&&this.tree.isOverSvg&&this.animateDropZone("show",this.dropZoneDelete.node(),t)):this.tree.hoveredNode?this.dropZoneDelete&&"false"!==this.dropZoneDelete.node().dataset.open&&this.animateDropZone("hide",this.dropZoneDelete.node(),t):(this.dragDrop.addNodeDdClass(o,"nodrop"),this.tree.nodesBgContainer.selectAll(".node-bg__border").style("display","none")),this.dragDrop.changeNodeClasses(e),!0}dragEnd(e){const t=e.subject;if(this.dropZoneDelete&&"true"===this.dropZoneDelete.node().dataset.open){const e=this.dropZoneDelete;this.animateDropZone("hide",this.dropZoneDelete.node(),t,()=>{e.remove(),this.dropZoneDelete=null})}else this.dropZoneDelete&&"false"===this.dropZoneDelete.node().dataset.open?(this.dropZoneDelete.remove(),this.dropZoneDelete=null):this.dropZoneDelete=null;if(!this.startDrag||!0!==this.tree.settings.allowDragMove||0===t.depth)return!1;const i=this.tree.hoveredNode;if(this.isDragged=!1,this.dragDrop.removeNodeDdClass(),t.isOver||i&&-1!==i.parentsStateIdentifier.indexOf(t.stateIdentifier)||!this.tree.settings.canNodeDrag||!this.tree.isOverSvg){if(this.nodeIsOverDelete){const e=this.dragDrop.changeNodePosition(i,"delete");if(null===e)return!1;if(this.tree.settings.displayDeleteConfirmation){u.confirm(TYPO3.lang.deleteItem,TYPO3.lang["mess.delete"].replace("%s",e.node.name),m.warning,[{text:TYPO3.lang["labels.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:TYPO3.lang["cm.delete"]||"Delete",btnClass:"btn-warning",name:"delete"}]).on("button.clicked",t=>{"delete"===t.target.name&&this.tree.sendChangeCommand(e),u.dismiss()})}else this.tree.sendChangeCommand(e)}}else{const e=this.dragDrop.changeNodePosition(i,"");if(null===e)return!1;let t=e.position===g.DraggablePositionEnum.INSIDE?TYPO3.lang["mess.move_into"]:TYPO3.lang["mess.move_after"];t=t.replace("%s",e.node.name).replace("%s",e.target.name),u.confirm(TYPO3.lang.move_page,t,m.warning,[{text:TYPO3.lang["labels.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:TYPO3.lang["cm.copy"]||"Copy",btnClass:"btn-warning",name:"copy"},{text:TYPO3.lang["labels.move"]||"Move",btnClass:"btn-warning",name:"move"}]).on("button.clicked",t=>{const i=t.target;"move"===i.name?(e.command="move",this.tree.sendChangeCommand(e)):"copy"===i.name&&(e.command="copy",this.tree.sendChangeCommand(e)),u.dismiss()})}return!0}getDropZoneOpenTransform(e){return"translate("+((parseFloat(this.tree.svg.style("width"))||300)-58-e.x)+"px, -10px)"}getDropZoneCloseTransform(e){return"translate("+((parseFloat(this.tree.svg.style("width"))||300)-e.x)+"px, -10px)"}animateDropZone(e,t,i,o=null){t.classList.add("animating"),t.dataset.open="show"===e?"true":"false";let n=[{transform:this.getDropZoneCloseTransform(i)},{transform:this.getDropZoneOpenTransform(i)}];"show"!==e&&(n=n.reverse());const s=function(){t.style.transform=n[1].transform,t.classList.remove("animating"),o&&o()};"animate"in t?t.animate(n,{duration:300,easing:"cubic-bezier(.02, .01, .47, 1)"}).onfinish=s:s()}}}));
\ No newline at end of file
-- 
GitLab