diff --git a/src/js/techreport/summaryCards.js b/src/js/techreport/summaryCards.js index 3d71256b..62ae80c0 100644 --- a/src/js/techreport/summaryCards.js +++ b/src/js/techreport/summaryCards.js @@ -73,14 +73,14 @@ class SummaryCard { }); } - if(latestChange && latestChange.string && latestChange.perc) { + if(latestChange && latestChange.string && latestChange.perc != null) { const changeSlot = card.querySelector('[data-slot="change"]'); const changeMeaning = changeSlot?.dataset?.meaning; if(changeSlot) { changeSlot.textContent = latestChange.string; const styling = UIUtils.getChangeStatus(latestChange.perc, changeMeaning); - changeSlot.classList.add(styling?.color, styling?.direction); + changeSlot.className = `monthchange ${styling?.color} ${styling?.direction}`; } } } diff --git a/src/js/techreport/table.js b/src/js/techreport/table.js index 59555c6d..5bc35995 100644 --- a/src/js/techreport/table.js +++ b/src/js/techreport/table.js @@ -194,7 +194,7 @@ function updateTable(id, config, appConfig, apps, data) { } if(column.styling) { - wrapper.classList.add('monthchange', column.styling?.direction, column.styling?.color); + wrapper.className = `monthchange ${column?.styling?.color} ${column?.styling?.direction}`; } // Add cell to the row diff --git a/src/js/techreport/timeseries.js b/src/js/techreport/timeseries.js index 55cb525f..d8058873 100644 --- a/src/js/techreport/timeseries.js +++ b/src/js/techreport/timeseries.js @@ -175,7 +175,7 @@ class Timeseries { const styling = UIUtils.getChangeStatus(latestMoM, changeMeaning); const monthChange = document.createElement('span'); monthChange.textContent = latestMoMStr; - monthChange.classList.add('monthchange', styling?.color, styling.direction); + monthChange.className = `monthchange ${styling?.color} ${styling?.direction}`; itemWrapper.appendChild(monthChange); } @@ -250,7 +250,7 @@ class Timeseries { const styling = UIUtils.getChangeStatus(latestMoM, changeMeaning); const monthChange = document.createElement('span'); monthChange.textContent = latestMoMStr; - monthChange.classList.add('monthchange', styling?.color, styling.direction); + monthChange.className = `monthchange ${styling?.color} ${styling?.direction}`; card.appendChild(monthChange); } }