X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=d259e272f9d9229a95e11a8bc2ac53a12835846e;hp=c9ff8d8291f4f8f2799a6e83a1003868d59fa4b0;hb=7d32d14ab6626993cc72c1d3cebc40f13e95dbed;hpb=f662b895fc40db21c3d667b16e5a8f2d3f55dfd7 diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index c9ff8d8..d259e27 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -261,7 +261,7 @@ var find_nonstupid_moves = function(data, margin) { moves.push(move); } } - moves = moves.sort(function(a, b) { return compare_by_score(data.refutation_lines, a, b) }); + moves = moves.sort(function(a, b) { return compare_by_score(data.refutation_lines, data.position.toplay, a, b) }); moves.unshift(data.pv_uci[0]); return moves; @@ -317,6 +317,10 @@ var update_highlight = function() { } var update_refutation_lines = function(board) { + if (display_lines.length > 1) { + display_lines = [ display_lines[0] ]; + } + var tbl = $("#refutationlines"); tbl.empty(); @@ -370,6 +374,8 @@ var update_refutation_lines = function(board) { } var update_board = function(board, data, num_viewers) { + display_lines = []; + // The headline. var headline = 'Analysis'; if (data.position.last_move !== 'none') {