Skip to content

Commit

Permalink
[BUGFIX] cross-page drag and drop
Browse files Browse the repository at this point in the history
Fixes: #533
  • Loading branch information
achimfritz committed Oct 14, 2024
1 parent 8528269 commit 85c252a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Build/JavaScript/js-13.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 4e8c22eb07e80cd1e2c458f4bb34e8b429f44aff Mon Sep 17 00:00:00 2001
From: Achim Fritz <[email protected]>
Date: Sun, 2 Jun 2024 15:58:42 +0200
Subject: [PATCH] [PATCH] js-13
From 2fb0e5b5b10878b804d9845bb7baa186b140396f Mon Sep 17 00:00:00 2001
From: Achim Fritz <[email protected]>
Date: Mon, 14 Oct 2024 14:35:21 +0200
Subject: [PATCH] [PATCH] js-13-main

Change-Id: I79c575c643026091b31e4d5f8a8b60898fa7f70f
Change-Id: I1b3ee3edd8fe045185268f6b17f98b150f342001
---
.../backend/layout-module/drag-drop.ts | 32 +++++++++++++------
.../TypeScript/backend/layout-module/paste.ts | 23 ++++++++-----
2 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts b/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
index 21dbdc58f57..d7aa60fdf40 100644
index f14320f9dea..56ab0a01fc4 100644
--- a/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
+++ b/Build/Sources/TypeScript/backend/layout-module/drag-drop.ts
@@ -15,20 +15,20 @@
Expand Down Expand Up @@ -40,10 +40,10 @@ index 21dbdc58f57..d7aa60fdf40 100644
cmd?: { [key: string]: { [key: string]: any } };
data?: { [key: string]: { [key: string]: any } };
- CB?: { paste: string, update: { colPos: number | boolean, sys_language_uid: number } };
+ CB?: { paste: string, update: { colPos: number | boolean, sys_language_uid: number, txContainerParent: number } };
+ CB?: { paste: string, update: { colPos: number | boolean, sys_language_uid: number , txContainerParent: number } };
}

type ContentElementDragDropData = {
export type ContentElementDragDropData = {
@@ -175,6 +175,7 @@ class DragDrop {
}

Expand Down
1 change: 1 addition & 0 deletions Classes/Backend/Preview/ContainerPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$view->assign('containerGrid', $grid);
$view->assign('grid', $grid);
$view->assign('containerRecord', $record);
$view->assign('context', $context);
$beforeContainerPreviewIsRendered = new BeforeContainerPreviewIsRenderedEvent($container, $view);
$this->eventDispatcher->dispatch($beforeContainerPreviewIsRendered);
$rendered = $view->render();
Expand Down
9 changes: 8 additions & 1 deletion Resources/Private/Partials/PageLayout/Record.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{f:if(condition: '{item.disabled} && {item.context.drawingConfiguration.showHidden} == 0', then: 'display: none;') -> f:variable(name: 'style')}
<div class="t3-page-ce {item.wrapperClassName} t3js-page-ce t3js-page-ce-sortable" id="element-tt_content-{item.record.uid}" data-table="tt_content" data-uid="{item.record.uid}" data-language-uid="{item.record.sys_language_uid}" style="{style}">
<div class="t3-page-ce {item.wrapperClassName} t3js-page-ce t3js-page-ce-sortable"
id="element-tt_content-{item.record.uid}"
data-table="tt_content"
data-uid="{item.record.uid}"
data-language-uid="{item.record.sys_language_uid}"
data-move-element-url="{f:be.uri(route: 'move_element', parameters: '{uid: item.record.uid, originalPid: item.record.pid, expandPage: item.record.pid, returnUrl: context.returnUrl}')}"
style="{style}"
>
<div class="t3-page-ce-element t3-page-ce-dragitem t3js-page-ce-dragitem" id="{item.uniqueId}">
<f:render partial="PageLayout/Record/{item.record.CType}/Header" arguments="{_all}" optional="1">
<f:render partial="PageLayout/RecordDefault/Header" arguments="{_all}" />
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Overrides/drag-drop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85c252a

Please sign in to comment.