Skip to content

Commit 25e581b

Browse files
committed
MC-4262: Column Rearranging Drop Zone Indicators Are Too Small & Sometimes Hard To Activate
- Show better indicator when dragging columns
1 parent 6c806ef commit 25e581b

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_drag-drop.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
}
4646
}
4747

48-
.pagebuilder-content-type-wrapper.ui-sortable-helper {
48+
.pagebuilder-content-type-wrapper.ui-sortable-helper,
49+
.pagebuilder-content-type.ui-draggable-dragging {
4950
opacity: .7;
5051

5152
.pagebuilder-options {

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/column-group/_default.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
opacity: 0;
4545
position: absolute;
4646
top: -1px;
47-
transform: translateX(-3px);
48-
transition: .5s opacity;
4947
visibility: hidden;
5048
width: 6px;
5149
z-index: 26;

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/column-group/preview.js

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/column-group/preview.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,25 @@ export default class Preview extends PreviewCollection {
802802

803803
if (this.movePosition) {
804804
this.dropPlaceholder.removeClass("left right");
805+
const width = dragColumn.preview.element.outerWidth();
806+
let left = (this.movePosition.placement === "left" ? this.movePosition.left : null);
807+
// The right position is only used when moving a column to the last position in the group
808+
const right = (this.movePosition.placement === "right" ?
809+
groupPosition.outerWidth - this.movePosition.right : null
810+
);
811+
/**
812+
* If we're dragging the column from the left to the right we need to show the placeholder on
813+
* the left hand side.
814+
*/
815+
if (left !== null && this.parent.children().indexOf(dragColumn) <
816+
this.parent.children().indexOf(this.movePosition.affectedColumn)
817+
) {
818+
left = left - width;
819+
}
805820
this.movePlaceholder.css({
806-
left: (this.movePosition.placement === "left" ? this.movePosition.left : ""),
807-
right: (this.movePosition.placement === "right" ?
808-
groupPosition.outerWidth - this.movePosition.right - 5 : ""
809-
),
821+
width,
822+
left,
823+
right,
810824
}).addClass("active");
811825
} else {
812826
this.movePlaceholder.removeClass("active");

0 commit comments

Comments
 (0)