diff --git a/index.html b/index.html index 7a70ad3..2e47e4f 100644 --- a/index.html +++ b/index.html @@ -40,16 +40,16 @@
- + - +
- + D+ - +
diff --git a/js/sr2ini.js b/js/sr2ini.js index dca8718..94a2646 100644 --- a/js/sr2ini.js +++ b/js/sr2ini.js @@ -32,12 +32,12 @@ function handleBlur (e) { } // did value stay the same? do nothing then - if ( e.target.value == $(e.target).parents("tr").attr("data-ini") ) { + if ( e.target.value == $tr.attr("data-ini") ) { return true; } // value changed => reposition row - $(e.target).parents("tr").attr("data-ini", e.target.value); + $tr.attr("data-ini", e.target.value); let $trc = $tr.clone(true); $tr.remove(); insertCombRow($trc); @@ -229,6 +229,7 @@ function addCombatant (e) { // add handlers to table row object $tr.find("input[class*='comb']").on("blur", handleBlur); + $tr.find("input[type='number']").bind('keyup input change', handleBlur); $tr.find("button.act-button").on("click", handleActButtonClick); $tr.find("button.remove-button").on("click", handleRemoveButtonClick);