Loading static/js/cards.mjs +1 −8 Changes for static/js/cards.mjs: 1 added line, 8 removed lines. Original line number Diff line number Diff line Loading @@ -3,21 +3,14 @@ import { createElementWithClass } from "./util.mjs" /** * Create an HTML card * @param {String} title The title the card should have (placed inside an <h2>) * @param {String | undefined} icon Optional: Name of a bootstrap icon (e.g. "bi-check-square") to be placed left to the title * @param {String | undefined} supplemental Optional: A supplemental text that is placed floating right to the title * @returns A div.card DOM element */ export function createCard(title, icon, supplemental) { export function createCard(title, supplemental) { const cardEl = createElementWithClass("div", "card") const titleEl = createElementWithClass("div", "title") if(icon !== undefined) { const iconEl = createElementWithClass("i", "icon", "bi") iconEl.classList.add(icon) titleEl.append(iconEl) } const h2El = document.createElement("h2") h2El.textContent = title titleEl.append(h2El) Loading Loading
static/js/cards.mjs +1 −8 Changes for static/js/cards.mjs: 1 added line, 8 removed lines. Original line number Diff line number Diff line Loading @@ -3,21 +3,14 @@ import { createElementWithClass } from "./util.mjs" /** * Create an HTML card * @param {String} title The title the card should have (placed inside an <h2>) * @param {String | undefined} icon Optional: Name of a bootstrap icon (e.g. "bi-check-square") to be placed left to the title * @param {String | undefined} supplemental Optional: A supplemental text that is placed floating right to the title * @returns A div.card DOM element */ export function createCard(title, icon, supplemental) { export function createCard(title, supplemental) { const cardEl = createElementWithClass("div", "card") const titleEl = createElementWithClass("div", "title") if(icon !== undefined) { const iconEl = createElementWithClass("i", "icon", "bi") iconEl.classList.add(icon) titleEl.append(iconEl) } const h2El = document.createElement("h2") h2El.textContent = title titleEl.append(h2El) Loading