small changes
This commit is contained in:
parent
8d9fdb0f6f
commit
836af1c7e6
@ -40,16 +40,16 @@
|
||||
<tr class="table-primary combRow" id="newCombRow">
|
||||
<form name="newCombForm" class="combForm was-validated" onsubmit="return false;">
|
||||
<td>
|
||||
<input type="text" maxlength="40" class="form-control combName" form="newComForm" placeholder="Name" required />
|
||||
<input type="text" maxlength="40" class="form-control combName" form="newCombForm" placeholder="Name" required />
|
||||
</td>
|
||||
<td class="col-sm-2">
|
||||
<input type="number" min="0" max="50" class="form-control combIni" form="newComForm" placeholder="Ini" />
|
||||
<input type="number" min="0" max="50" class="form-control combIni" form="newCombForm" placeholder="Ini" />
|
||||
</td>
|
||||
<td class="col-sm-3">
|
||||
<div class="input-group">
|
||||
<input type="number" min="1" max="5" class="form-control combDice" form="newComForm" placeholder="Dice" />
|
||||
<input type="number" min="1" max="5" class="form-control combDice" form="newCombForm" placeholder="Dice" />
|
||||
<span class="input-group-text">D+</span>
|
||||
<input type="number" min="1" max="20" class="form-control combRea" form="newComForm" placeholder="REA" />
|
||||
<input type="number" min="1" max="20" class="form-control combRea" form="newCombForm" placeholder="REA" />
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user