diff --git a/css/custom.css b/css/custom.css
index 2d33053..7e9203c 100644
--- a/css/custom.css
+++ b/css/custom.css
@@ -8,10 +8,3 @@
input:invalid {
border: 2px solid red;
}
-
-/*td.combatantDice, td.combatantRea {
- width: 35%;
-}
-
-button:disabled {
-} */
diff --git a/js/sr2ini.js b/js/sr2ini.js
index 3e34081..79da508 100644
--- a/js/sr2ini.js
+++ b/js/sr2ini.js
@@ -104,6 +104,11 @@ function handleAddButtonClick (e) {
}
+function handleDamageButtonHover (e) {
+
+}
+
+
// click handler for edit buttons
function handleEditButtonClick (e) {
// find current table row
@@ -231,8 +236,8 @@ function addCombatant (e) {
'
\n',
'\n',
' \n',
- ' \n',
- ' \n',
+ ' \n',
+ ' \n',
' \n',
' | \n',
''].join("")
@@ -315,6 +320,40 @@ function newRound() {
}
+// add test combatant for testing purposes (duh)
+function addTestCombatant() {
+ // construct jQuery object for table row
+ let $tr = $($.parseHTML( [
+ '\n',
+ '| Test-Goon | \n',
+ '12 | \n',
+ '2D+6 | \n',
+ '\n',
+ '\n',
+ ' \n',
+ ' \n',
+ ' \n',
+ ' \n',
+ ' | \n',
+ '
'].join("")
+ ));
+
+ // add handlers to table row buttons
+ $tr.find("button.edit-button").on("click", handleEditButtonClick);
+ $tr.find("button.act-button").on("click", handleActButtonClick);
+ $tr.find("button.remove-button").on("click", handleRemoveButtonClick);
+
+ // add handlers to table cells (click to edit)
+ $tr.find(".combatantName, .combatantIni, .combatantDiceAndRea").on("click", handleEditButtonClick);
+
+ // add row to table and sort
+ $("#combatantsTable").append($tr);
+ sortTable();
+}
+
+
/*
* Initialize document
*/
@@ -338,4 +377,6 @@ $(document).ready(function(){
$("#combatantModal input[id*='combatantModal']").val("");
})
+// addTestCombatant();
+
});