diff --git a/_assets/javascripts/custom.js b/_assets/javascripts/custom.js index d9dc4b7..474c666 100644 --- a/_assets/javascripts/custom.js +++ b/_assets/javascripts/custom.js @@ -1,6 +1,16 @@ $(function() { + /* Convert score to numeric number for sorting */ + $.tablesorter.addParser({ + id: 'score', + format: function(s, table, cell, cellIndex) { + return s.replace(/½/,'.5'); + }, + type: 'numeric' + }); + /* Sort a tournament table with tablesorter */ - $('.tablesorter .opponent').addClass('{sorter: false}'); + $('.tablesorter th.score').data('sorter', false); + $('.tablesorter th.total').data('sorter', 'score'); $('.tablesorter').tablesorter({ theme : 'blue', widgets : ['zebra'],