ng-masonry-grid
ng-masonry-grid copied to clipboard
Image reOrderItems breaks the grid when columnWidth uses selector
The reOrderItems() function removes all children along with columnWidth selector element.
Masonry options
{
...
"columnWidth": ".spacer"
...
}
The prototype class has the following code which breaks the grid during items reorder.
NgMasonryGridService.prototype.reorderMasonryItems
This code removes the first spacer element in the grid, which causes the grid misalignment.
while (this.el.hasChildNodes()) {
this.el.removeChild(lastChild);
}
Please add an condition to check if the columnWidth
is an integer or string. If its string then a selector is being used, the removeChild()
function can be skipped for columnWidth
element.