Skip to content

Commit 2b9e4eb

Browse files
committed
PB-1205 - allow groups top be dropped at top
1 parent a394ae5 commit 2b9e4eb

File tree

2 files changed

+17
-8
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+17
-8
lines changed

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

Lines changed: 9 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-line/preview.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,16 @@ export default class Preview extends PreviewCollection {
744744

745745
const siblings = this.contentType.parentContentType.children();
746746
const id = this.contentType.id;
747-
const firstLine = siblings.shift();
747+
let index = 0;
748+
siblings.forEach((columnLine) => {
749+
if (columnLine.id === id){
750+
return false;
751+
}
752+
index++;
753+
});
748754
// show column line drop placeholder only for top column line in a group
749-
const draggedColumn = getDragColumn();
750755

751-
return (this.dropOverElement || draggedColumn) &&
756+
return this.dropOverElement &&
752757
event.pageY > linePosition.top &&
753758
event.pageY < linePosition.top + this.lineDropperHeight;
754759
}
@@ -1186,7 +1191,6 @@ export default class Preview extends PreviewCollection {
11861191
private getNewColumnLineIndex(): number {
11871192
let index = -1;
11881193
const self = this;
1189-
alert(this.contentType.parentContentType.getChildren()().length);
11901194
for (const child of this.contentType.parentContentType.children()) {
11911195
index++;
11921196
if (child.id == self.contentType.id) {

0 commit comments

Comments
 (0)