various bugfixes, e.g. that data-ini will only be compared and filled with actual ini values

This commit is contained in:
Tobias 2023-02-01 23:13:59 +01:00
parent 836af1c7e6
commit cfee510e38

View File

@ -31,13 +31,13 @@ function handleBlur (e) {
return false; return false;
} }
// did value stay the same? do nothing then // did Ini value stay the same? do nothing then
if ( e.target.value == $tr.attr("data-ini") ) { if ( $tr.find(".combIni")[0].value == $tr.attr("data-ini") ) {
return true; return true;
} }
// value changed => reposition row // Ini value changed => reposition row
$tr.attr("data-ini", e.target.value); $tr.attr("data-ini", $tr.find(".combIni")[0].value);
let $trc = $tr.clone(true); let $trc = $tr.clone(true);
$tr.remove(); $tr.remove();
insertCombRow($trc); insertCombRow($trc);
@ -115,7 +115,7 @@ console.log("I/D/R: " + ini + "/" + dice + "/" + rea);
} }
// invalidate if value for ini doesn't align with values for dice+rea // invalidate if value for ini doesn't align with values for dice+rea
if ( ini != "" && dice != "" && rea != "" ) { /* if ( ini != "" && dice != "" && rea != "" ) {
let d = parseInt(dice); let d = parseInt(dice);
let r = parseInt(rea); let r = parseInt(rea);
if ( ini < d+r || ini > d*6+r ) { if ( ini < d+r || ini > d*6+r ) {
@ -124,7 +124,7 @@ console.log("I/D/R: " + ini + "/" + dice + "/" + rea);
inputElements[1].setCustomValidity(""); inputElements[1].setCustomValidity("");
return false; return false;
} }
} }*/
// ok fine // ok fine
return true; return true;