From 74ab36f49b172750fcd2ac4749ab880bac766273 Mon Sep 17 00:00:00 2001 From: Ben Huson Date: Tue, 3 Apr 2018 07:59:57 +0100 Subject: [PATCH 1/2] Ensure draggable placeholder has same column structure as dragged item. Copies the column structure of the dragged item, empties all the cell content and uses that as the placeholder to ensure the table structure is preserved. Signed-off-by: Ben Huson --- assets/js/src/simple-page-ordering.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/src/simple-page-ordering.js b/assets/js/src/simple-page-ordering.js index 1c4e03d..273d69e 100644 --- a/assets/js/src/simple-page-ordering.js +++ b/assets/js/src/simple-page-ordering.js @@ -77,6 +77,7 @@ sortable_post_table.sortable({ inlineEditPost.revert(); } ui.placeholder.height(ui.item.height()); + ui.placeholder.html(ui.item.html()).find('> th, > td').html(''); }, helper: function(e, ui) { var children = ui.children(); From 513145f3dfcdcaa2857724372caba897ef787853 Mon Sep 17 00:00:00 2001 From: Ben Huson Date: Thu, 5 Apr 2018 07:24:00 +0100 Subject: [PATCH 2/2] Clear drag-n-drop placeholder as simpler solution for column distortion when dragging. Signed-off-by: Ben Huson --- assets/js/src/simple-page-ordering.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/src/simple-page-ordering.js b/assets/js/src/simple-page-ordering.js index 273d69e..1776a2e 100644 --- a/assets/js/src/simple-page-ordering.js +++ b/assets/js/src/simple-page-ordering.js @@ -77,7 +77,7 @@ sortable_post_table.sortable({ inlineEditPost.revert(); } ui.placeholder.height(ui.item.height()); - ui.placeholder.html(ui.item.html()).find('> th, > td').html(''); + ui.placeholder.empty(); }, helper: function(e, ui) { var children = ui.children();