From 3ba7b2d136cb6052c5f8fa1b96ea44e6ddbf6988 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 31 May 2021 17:05:12 +1000 Subject: [PATCH] Visual hack for custom part card view --- InvenTree/templates/js/part.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/js/part.js b/InvenTree/templates/js/part.js index 5c2840b121..81cc4e0630 100644 --- a/InvenTree/templates/js/part.js +++ b/InvenTree/templates/js/part.js @@ -516,11 +516,21 @@ function loadPartTable(table, url, options={}) { var html = ''; - data.forEach(function(row) { + html = `
`; + + data.forEach(function(row, index) { + + // Force a new row every 4 columns, to prevent visual issues + if ((index > 0) && (index % 4 == 0) && (index < data.length)) { + html += `
`; + } + html += partGridTile(row); }); - return `
${html}
`; + html += `
`; + + return html; } });