X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=app.js;h=7d387c5702a6400c1ff75f81d67f5c88d240a15b;hp=bb1653789337d5e8f4cb8a2e280eea2b71d3d6e7;hb=f54357573d4fdf87a05b19f78506c11f16bb3a26;hpb=fe234391b05ffef5e3236e82ca1391adcb784b45 diff --git a/app.js b/app.js index bb16537..7d387c5 100644 --- a/app.js +++ b/app.js @@ -191,7 +191,9 @@ function getGameLink() { const vname = $.getElementById("selectVariant").value; const color = $.getElementById("selectColor").value; for (const select of $.querySelectorAll("#gameOptions select")) { - const value = parseInt(select.value, 10) || select.value; + let value = parseInt(select.value, 10); + if (isNaN(value)) //not an integer + value = select.value; options[ select.id.split("_")[1] ] = value; } for (const input of $.querySelectorAll("#gameOptions input")) { @@ -229,7 +231,7 @@ function fillGameInfos(gameInfos, oppIndex) { if (j == options.length) break; const opt = options[j]; - if (!opt[1]) + if (!opt[1]) //includes 0 and false (lighter display) continue; htmlContent += '' +