var highlight_to = undefined;
/** The HTML object of the move currently being highlighted (in red).
- * @type {?jQuery}
+ * @type {?Element}
* @private */
var highlighted_move = null;
var arrow_size = arrow.arrow_size * zoom_factor;
var square_width = document.querySelector(".square-a8").getBoundingClientRect().width;
- var pos, from_y, to_y, from_x, to_x;
+ var from_y, to_y, from_x, to_x;
if (board.orientation() === 'black') {
- pos = document.querySelector(".square-h1").getBoundingClientRect(); // FIXME: margin?
from_y = (arrow.from_row + 0.5)*square_width;
to_y = (arrow.to_row + 0.5)*square_width;
from_x = (7 - arrow.from_col + 0.5)*square_width;
to_x = (7 - arrow.to_col + 0.5)*square_width;
} else {
- pos = document.querySelector(".square-a8").getBoundingClientRect(); // FIXME: margin?
from_y = (7 - arrow.from_row + 0.5)*square_width;
to_y = (7 - arrow.to_row + 0.5)*square_width;
from_x = (arrow.from_col + 0.5)*square_width;
head.setAttribute("fill", arrow.fg_color);
svg.appendChild(head);
- svg.style.top = pos.top;
- svg.style.left = pos.left;
+ svg.style.top = '2px'; /* Border for .board-b72b1. */
+ svg.style.left = '2px';
svg.style.pointerEvents = 'none';
- document.body.appendChild(svg);
+ document.getElementById('board').appendChild(svg);
arrow.svg = svg;
}
} else if (truncate_display_history) {
document.getElementById("history").innerHTML = print_pv(0, null, 8, true);
} else {
- document.getElementById("history").html(
+ document.getElementById("history").innerHTML =
'(<a class="move" href="javascript:collapse_history(true)">collapse</a>) ' +
- print_pv(0, null));
+ print_pv(0, null);
}
}
update_board();
return;
} else {
- current_display_line = jQuery.extend({}, display_lines[line_num]); // Shallow clone.
+ current_display_line = {...display_lines[line_num]}; // Shallow clone.
current_display_move = move_num + current_display_line.start_display_move_num;
}
current_display_line_is_history = (line_num == 0);