X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=www%2Fjs%2Fremoteglot.js;h=c2bf8ff482b7f69cb07bc09c4b1accd0659850e9;hb=7afc6af9d2dbe5af72ad7b8308b74dad245559c0;hp=5314a5681dbbbfbf7c589cd253b1179388988777;hpb=ddeb2eaf98778f23b624212fa100db79a8be8560;p=remoteglot diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 5314a56..c2bf8ff 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -734,6 +734,7 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { let ret = document.createDocumentFragment(); let in_tb = false; + let i = 0; if (opt_limit && opt_showlast && pv.length > opt_limit) { // Truncate the PV at the beginning (instead of at the end). // We assume here that toplay is 'W'. We also assume that if @@ -754,7 +755,7 @@ function print_pv(line_num, splicepos, opt_limit, opt_showlast) { } else if (toplay == 'B' && pv.length > 0) { ret.appendChild(document.createTextNode(move_num + '. … ')); } - for (let i = 0; i < pv.length; ++i) { + for (; i < pv.length; ++i) { let link = document.createElement('a'); link.className = 'move'; link.setAttribute('id', 'automove' + line_num + '-' + i);