Spaces:
Running
Running
For all cells in the row except the first one
Browse files
app.py
CHANGED
|
@@ -425,15 +425,17 @@ function addTitleForEachCellOfLeaderboardTable(){
|
|
| 425 |
// Get the value of the title attribute from the first link
|
| 426 |
const titleText = firstCellLink.getAttribute('title');
|
| 427 |
|
| 428 |
-
// Set the model_title attribute for all cells in the row
|
| 429 |
-
row.querySelectorAll('td').forEach(cell => {
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
}
|
| 434 |
-
|
| 435 |
-
// Set the model_title attribute permanently
|
| 436 |
-
cell.setAttribute('model_title', titleText);
|
| 437 |
});
|
| 438 |
}
|
| 439 |
});
|
|
|
|
| 425 |
// Get the value of the title attribute from the first link
|
| 426 |
const titleText = firstCellLink.getAttribute('title');
|
| 427 |
|
| 428 |
+
// Set the model_title attribute for all cells in the row except the first one
|
| 429 |
+
row.querySelectorAll('td').forEach((cell, index) => {
|
| 430 |
+
if (index !== 0) {
|
| 431 |
+
// If the cell already has a model_title attribute, break the loop
|
| 432 |
+
if (cell.hasAttribute('model_title')) {
|
| 433 |
+
return; // Exit the current iteration for this row
|
| 434 |
+
}
|
| 435 |
+
|
| 436 |
+
// Set the model_title attribute permanently
|
| 437 |
+
cell.setAttribute('model_title', titleText);
|
| 438 |
}
|
|
|
|
|
|
|
|
|
|
| 439 |
});
|
| 440 |
}
|
| 441 |
});
|