Commit edafc556 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1856506: gridstack: adding extra checks for non numbers"

parents a0843e97 ecfa80e3
......@@ -150,7 +150,7 @@ function updateTranslatedGridRows(blocks) {
if (block.row > 1) {
// get the actual y value based on the max height of previous rows
for (var i = 1; i < block.row; i++) {
if (typeof(maxheight[i]) != 'undefined') {
if (typeof(maxheight[i]) != 'undefined' && !isNaN(maxheight[i])) {
y += maxheight[i];
}
}
......@@ -186,7 +186,11 @@ function updateTranslatedGridRows(blocks) {
else {
height[block.row][block.column] += realheight;
}
maxheight[block.row] = Math.max.apply(null, height[block.row]);
// need to filter values that are not numbers
var allnumbers = height[block.row].filter(function (el) {
return Number.isInteger(el);
});
maxheight[block.row] = Math.max.apply(null, allnumbers);
});
// update all blocks together
moveBlocks(updatedGrid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment