From 51c037498c64b33e4de391614c029f3f58cb38b4 Mon Sep 17 00:00:00 2001 From: SocksTheWolf <132639882+SocksTheWolf@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:13:17 -0700 Subject: [PATCH] Small changes again Add shift click to delete, change default column sizes, turn off spellcheck underlines by default --- assets/js/tier-table.js | 7 ++++--- index.html | 14 ++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/assets/js/tier-table.js b/assets/js/tier-table.js index f81b89b..da72f69 100644 --- a/assets/js/tier-table.js +++ b/assets/js/tier-table.js @@ -133,9 +133,9 @@ function addRow() { table_body.appendChild(row); } -function deleteRow(row_id) { +function deleteRow(row_id, shiftClicked) { const tier_title = document.getElementById(row_id).firstChild.innerText; - if (confirm(`Are you sure you want to delete row "${tier_title}"?`) == true) { + if (shiftClicked || confirm(`Are you sure you want to delete row "${tier_title}"?`)) { const row = document.getElementById(row_id); row.parentElement.removeChild(row); } @@ -149,7 +149,7 @@ function createSettingsTd(row_id, table_id) { let go_down = createFAElement("fas", "fa-level-down-alt"); go_down.addEventListener("click", () => moveRowDown(row_id, table_id)); let delete_row = createFAElement("fas", "fa-trash"); - delete_row.addEventListener("click", () => deleteRow(row_id)); + delete_row.addEventListener("click", (ev) => deleteRow(row_id, ev.shiftKey)); let container = document.createElement("td"); [add, go_up, go_down, delete_row].forEach((el, idx, max) => { @@ -180,6 +180,7 @@ function generateTable(identifier, count = -1) { const tier_th = document.createElement("th"); tier_th.setAttribute("scope", "row"); tier_th.setAttribute("contenteditable", "true"); + tier_th.setAttribute("spellcheck", "false"); tier_th.classList.add( `tlm-bgcolor-${row_name}`, "text-center", diff --git a/index.html b/index.html index c985ec2..aaed902 100644 --- a/index.html +++ b/index.html @@ -99,12 +99,10 @@
Tier | -Content | -- Settings - | +
---|---|---|
Tier | +Content | +Settings |