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