Skip to content

Commit

Permalink
fix: Correctly select table body element
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Dec 16, 2024
1 parent 85218d7 commit e4e16b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aider/website/_includes/refactor-leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ document.addEventListener('DOMContentLoaded', function () {
leaderboardChart.update();
}

var tableBody = document.querySelectorAll('table tbody')[1];
var tableBody = document.querySelector('table tbody');
allData.forEach(function(row, index) {
var tr = tableBody.children[index];
tr.id = 'refac-row-' + index;
Expand Down Expand Up @@ -69,7 +69,7 @@ document.addEventListener('DOMContentLoaded', function () {
// Add search functionality for refactoring table
document.getElementById('refacSearchInput').addEventListener('keyup', function() {
var searchWords = this.value.toLowerCase().split(' ').filter(word => word.length > 0);
var tableBody = document.querySelectorAll('table tbody')[1];
var tableBody = document.querySelector('table tbody');
var rows = tableBody.getElementsByTagName('tr');

leaderboardData.labels = [];
Expand Down

0 comments on commit e4e16b8

Please sign in to comment.