瀏覽代碼

refactor: resultsHeader/Body→ ResultProperties sig

tags/v0.3.0
bertieb 3 年之前
父節點
當前提交
bccc86acc6
共有 1 個檔案被更改,包括 12 行新增12 行删除
  1. +12
    -12
      src/ts/frontend.ts

+ 12
- 12
src/ts/frontend.ts 查看文件

@@ -358,14 +358,14 @@ function resultsCard(resultsProperties: ResultProperties): JQuery<HTMLElement>{
* Set up results 'header' - class name (TODO) and number of dice rolled
*/

function resultsHeader(rollstats: RollStats): string {
function resultsHeader(resultProperties: ResultProperties): string {
// Use flexbox (d-flex) for LHS/RHS justification
let resultsBodyId = `resultsBody-${rollstats.numDice}`;
let resultsBodyId = `resultsBody-${resultProperties.itemId()}`;
let resultsTitle = `<div class="d-flex justify-content-between">`
resultsTitle += `<div>`
+ bigTitle(`Asphodice Results
<small class="h4 text-muted">
(<var>d=${rollstats.numDice}</var>)
(<var>d=${resultProperties.numDice}</var>)
</small>`)
+ `</div>`;
resultsTitle += `<div>
@@ -384,13 +384,13 @@ function resultsHeader(rollstats: RollStats): string {
* to be filled in afterwards
*/

function resultsBody(rollstats: RollStats): string {
let resultsBodyId = `resultsBody-${rollstats.numDice}`;
let resultsBody = `<div id="${resultsBodyId}" class="show row resultsToggle">`;
resultsBody += describeRolls(rollstats);
resultsBody += rerollReport(rollstats)
+ outcomesReport(rollstats)
+ outcomeBalancesReport(rollstats);
function resultsBody(resultProperties: ResultProperties): string {
let resultsBodyId = `resultsBody-${resultProperties.numDice}`;
let resultsBody = `<div id="${resultsBodyId}" class="show row resultsToggle ${resultProperties.variantClass()}">`;
resultsBody += describeRolls(resultProperties.rollstats);
resultsBody += rerollReport(resultProperties.rollstats)
+ outcomesReport(resultProperties.rollstats)
+ outcomeBalancesReport(resultProperties.rollstats);
resultsBody += `</div>`;
return resultsBody;
}
@@ -401,9 +401,9 @@ function resultsBody(rollstats: RollStats): string {
function addResults(resultProperties: ResultProperties): void {
let resultsCardBody = resultsCard(resultProperties);

resultsCardBody.append(resultsHeader(resultProperties.rollstats));
resultsCardBody.append(resultsHeader(resultProperties));

resultsCardBody.append(resultsBody(resultProperties.rollstats));
resultsCardBody.append(resultsBody(resultProperties));

// Post-DOM-Construction generation
//


Loading…
取消
儲存