Skip to content

Commit 4222a06

Browse files
committed
PB-108 apply left over width to all column lines after new grid size is set
1 parent 28ec3f3 commit 4222a06

File tree

2 files changed

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

2 files changed

+14
-8
lines changed

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

Lines changed: 6 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/grid-size.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,19 @@ function redistributeColumnWidths(
217217
(column.preview as ColumnPreview).updateDisplayLabel();
218218

219219
});
220-
if (Math.round(resizeUtils.getColumnsWidth()) < 100) {
221-
applyLeftoverColumnsInColumnLine(columnLine, newGridSize);
222-
}
223220
},
224221
);
225222

226-
// persist new grid size so upcoming calls to get column widths are calculated correctly
227223
columnGroup.dataStore.set("grid_size", newGridSize);
228224
columnGroup.dataStore.unset("initial_grid_size");
225+
columnGroup.getChildren()().forEach(
226+
(columnLine: ContentTypeCollectionInterface<ColumnLinePreview>, index: number) => {
227+
let resizeUtils = columnLine.preview.getResizeUtils();
228+
if (Math.round(resizeUtils.getColumnsWidth()) < 100) {
229+
applyLeftoverColumnsInColumnLine(columnLine, newGridSize);
230+
}
231+
},
232+
);
229233
}
230234

231235
/**

0 commit comments

Comments
 (0)