@@ -342,10 +342,11 @@ function describeRolls(rollstats: RollStats): string {
/**
* Set up results card that contains one set of RollStats results
*/
function resultsCard(rollstats: RollStat s): JQuery<HTMLElement>{
function resultsCard(resultsProperties: ResultPropertie s): JQuery<HTMLElement>{
// <div id="results"> is the general results div to append results to
// TODO: include class shortname in id (?)
let cardId = `results-aspho-${rollstats.numDice}`;
let cardId = `results-${resultsProperties.itemId()}`;
$("#results").append(`<div class="card my-4" id="${cardId}">`);
let resultsCard = $("#results").find(`#${cardId}`);
resultsCard.append(`<div class="card-body">`);
@@ -397,12 +398,12 @@ function resultsBody(rollstats: RollStats): string {
/**
* Put the results together - card, head, body → fill charts and tables
*/
function addResults(rollstats: RollStat s): void {
let resultsCardBody = resultsCard(rollstat s);
function addResults(resultProperties: ResultPropertie s): void {
let resultsCardBody = resultsCard(resultPropertie s);
resultsCardBody.append(resultsHeader(rollstats));
resultsCardBody.append(resultsHeader(resultProperties.r ollstats));
resultsCardBody.append(resultsBody(rollstats));
resultsCardBody.append(resultsBody(resultProperties.r ollstats));
// Post-DOM-Construction generation
//
@@ -413,10 +414,10 @@ function addResults(rollstats: RollStats): void {
// <canvas> element
// Tables
generateTables(rollstats);
generateTables(resultProperties.r ollstats);
// Charts
generateCharts(rollstats);
generateCharts(resultProperties.r ollstats);
}
/**
@@ -463,7 +464,7 @@ function getResults():void {
numDice: i,
});
rollstats.doRolls();
addResults(rollstat s);
addResults(resultPropertie s);
$("#resultsProgress").width(`${i/maxDice*100}%`);
$("#resultsProgress").text(`${i/maxDice*100}%`);
}