Skip to content

Commit 1a3d1ec

Browse files
committed
eslint fix
1 parent cac75ce commit 1a3d1ec

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

tcf_website/static/course/javascript/course_data.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,9 @@ const loadData = (data) => {
141141
};
142142

143143
const createChart = (gradesData) => {
144-
145144
const cardBgColor = getComputedStyle(document.body)
146-
.getPropertyValue("--card-background-color")
147-
.trim();
145+
.getPropertyValue("--card-background-color")
146+
.trim();
148147

149148
const chartData = {
150149
datasets: [
@@ -249,24 +248,24 @@ const createChart = (gradesData) => {
249248
Chart.register(ChartDataLabels);
250249

251250
// Set up a MutationObserver to update chart borderColor when the body class changes.
252-
const observer = new MutationObserver((mutationsList) => {
253-
for (const mutation of mutationsList) {
254-
if (mutation.attributeName === "class") {
255-
updateChartBorderColor();
251+
const observer = new MutationObserver((mutationsList) => {
252+
for (const mutation of mutationsList) {
253+
if (mutation.attributeName === "class") {
254+
updateChartBorderColor();
255+
}
256256
}
257-
}
258-
});
259-
observer.observe(document.body, { attributes: true });
257+
});
258+
observer.observe(document.body, { attributes: true });
260259

261-
function updateChartBorderColor() {
262-
const newCardBgColor = getComputedStyle(document.body)
263-
.getPropertyValue("--card-background-color")
264-
.trim();
265-
if (myChart && myChart.config.data.datasets[0]) {
266-
myChart.config.data.datasets[0].borderColor = newCardBgColor;
267-
myChart.update({ duration: 0 });
260+
function updateChartBorderColor() {
261+
const newCardBgColor = getComputedStyle(document.body)
262+
.getPropertyValue("--card-background-color")
263+
.trim();
264+
if (myChart && myChart.config.data.datasets[0]) {
265+
myChart.config.data.datasets[0].borderColor = newCardBgColor;
266+
myChart.update({ duration: 0 });
267+
}
268268
}
269-
}
270269
// Generate configuration for Pie Chart
271270
pieConfig = {
272271
type: "doughnut",

0 commit comments

Comments
 (0)