Skip to content

Commit d017db7

Browse files
committed
PB-108 remove dropPlaceholder functionality from column-group, it is in column-line now
1 parent 5841caf commit d017db7

File tree

3 files changed

+4
-57
lines changed

3 files changed

+4
-57
lines changed

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

Lines changed: 1 addition & 26 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/js/content-type/column/resize.js

Lines changed: 2 additions & 2 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: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ export default class Preview extends PreviewCollection {
435435

436436
/**
437437
* Init the drop placeholder
438+
* @deprecated - dropPlaceholder functionality moved to column-line
438439
*
439440
* @param {Element} element
440441
*/
@@ -544,7 +545,6 @@ export default class Preview extends PreviewCollection {
544545

545546
removeDragColumn();
546547

547-
this.dropPlaceholder.removeClass("left right");
548548
this.movePlaceholder.removeClass("active");
549549
this.startDragEvent = null;
550550

@@ -651,7 +651,6 @@ export default class Preview extends PreviewCollection {
651651
// Change the cursor back
652652
$("body").css("cursor", "");
653653

654-
this.dropPlaceholder.removeClass("left right");
655654
this.movePlaceholder.css("left", "").removeClass("active");
656655
this.resizeGhost.removeClass("active");
657656

@@ -687,7 +686,6 @@ export default class Preview extends PreviewCollection {
687686
intersects = false;
688687
this.groupPositionCache = null;
689688
this.dropPosition = null;
690-
this.dropPlaceholder.removeClass("left right");
691689
this.movePlaceholder.css("left", "").removeClass("active");
692690
}
693691
}).on("mouseup touchend", () => {
@@ -926,7 +924,6 @@ export default class Preview extends PreviewCollection {
926924
}
927925

928926
if (this.movePosition) {
929-
this.dropPlaceholder.removeClass("left right");
930927
this.movePlaceholder.css({
931928
left: (this.movePosition.placement === "left" ? this.movePosition.left : ""),
932929
right: (this.movePosition.placement === "right"
@@ -945,15 +942,6 @@ export default class Preview extends PreviewCollection {
945942
if (this.movePosition) {
946943
const classToRemove = (this.movePosition.placement === "left" ? "right" : "left");
947944
this.movePlaceholder.removeClass("active");
948-
this.dropPlaceholder.removeClass(classToRemove).css({
949-
left: (this.movePosition.placement === "left" ? this.movePosition.left : ""),
950-
right: (this.movePosition.placement === "right" ?
951-
groupPosition.width - this.movePosition.right : ""
952-
),
953-
width: groupPosition.width / this.resizeUtils.getGridSize() + "px",
954-
}).addClass(this.movePosition.placement);
955-
} else {
956-
this.dropPlaceholder.removeClass("left right");
957945
}
958946
}
959947
}
@@ -985,21 +973,12 @@ export default class Preview extends PreviewCollection {
985973
return currentX > position.left && currentX <= position.right && position.canShrink;
986974
});
987975

988-
if (this.dropPosition) {
989-
this.dropPlaceholder.removeClass("left right").css({
990-
left: (this.dropPosition.placement === "left" ? this.dropPosition.left : ""),
991-
right:
992-
(this.dropPosition.placement === "right" ? groupPosition.width - this.dropPosition.right : ""),
993-
width: groupPosition.width / this.resizeUtils.getGridSize() + "px",
994-
}).addClass(this.dropPosition.placement);
995-
}
996976
} else if (this.dropOverElement) {
997977
// Re-enable the column group sortable instance
998978
if (elementChildrenParent.data("ui-sortable")) {
999979
elementChildrenParent.sortable("option", "disabled", false);
1000980
}
1001981
this.dropPosition = null;
1002-
this.dropPlaceholder.removeClass("left right");
1003982
}
1004983
}
1005984

@@ -1015,7 +994,6 @@ export default class Preview extends PreviewCollection {
1015994
group.droppable({
1016995
deactivate() {
1017996
self.dropOverElement = null;
1018-
self.dropPlaceholder.removeClass("left right");
1019997

1020998
_.defer(() => {
1021999
// Re-enable the column group sortable instance & all children sortable instances
@@ -1053,20 +1031,14 @@ export default class Preview extends PreviewCollection {
10531031
},
10541032
drop() {
10551033
self.dropPositions = [];
1056-
self.dropPlaceholder.removeClass("left right");
10571034
},
10581035
out() {
10591036
self.dropOverElement = null;
1060-
self.dropPlaceholder.removeClass("left right");
10611037
},
10621038
over() {
10631039
// Is the element currently being dragged a column group?
10641040
if (getDraggedContentTypeConfig() === Config.getContentTypeConfig("column-group")) {
10651041
// Always calculate drop positions when an element is dragged over
1066-
self.dropPositions = calculateDropPositions(
1067-
self.contentType as ContentTypeCollectionInterface<ColumnGroupPreview>,
1068-
);
1069-
10701042
self.dropOverElement = true;
10711043
} else {
10721044
self.dropOverElement = null;

0 commit comments

Comments
 (0)