js: Use less-modern syntax in update_pixel_ratio

Stealing code from the MDN has the consequence that it uses shiny ES6
features like "const", "let", and "=>".  This looks a bit odd among
the more conservative style of the rest of Puzzles, so I've
downgraded it to "var" and "function".  I'll let the template string
stay because that actually helps readability.
This commit is contained in:
Ben Harris
2022-10-23 11:15:31 +01:00
parent 0254a163ff
commit a62217e9b4

View File

@ -533,8 +533,8 @@ function initPuzzle() {
* <https://developer.mozilla.org/en-US/docs/Web/API/Window/
* devicePixelRatio> (CC0).
*/
const update_pixel_ratio = () => {
let dpr = window.devicePixelRatio;
var update_pixel_ratio = function() {
var dpr = window.devicePixelRatio;
resizable_div.style.width = onscreen_canvas.width / dpr + "px";
matchMedia(`(resolution: ${dpr}dppx)`)
.addEventListener("change", update_pixel_ratio, { once: true })