Skip to content

Commit 09b889c

Browse files
authored
Update button spacing
1 parent 45f4ef9 commit 09b889c

1 file changed

Lines changed: 2 additions & 130 deletions

File tree

resources/js/scoutingPASS.js

Lines changed: 2 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -148,135 +148,6 @@ function addTimer(table, idx, name, data) {
148148
return idx + 1;
149149
}
150150

151-
// function addCounter(table, idx, name, data) {
152-
// const row = table.insertRow(idx);
153-
// const hasExtraInc = data.hasOwnProperty('plusInc1') || data.hasOwnProperty('plusInc2');
154-
155-
// // Error Handling
156-
// if (!data.hasOwnProperty('code')) {
157-
// const errorCell = row.insertCell(0);
158-
// errorCell.classList.add("title");
159-
// errorCell.innerHTML = `Error: No code specified for ${name}`;
160-
// return idx + 1;
161-
// }
162-
163-
// const cell1 = row.insertCell(0);
164-
// let targetCell;
165-
166-
// cell1.classList.add("title");
167-
// if (data.hasOwnProperty('tooltip')) cell1.setAttribute("title", data.tooltip);
168-
169-
// if (hasExtraInc) {
170-
// cell1.setAttribute("colspan", 2);
171-
172-
// cell1.style.textAlign = "center";
173-
174-
// Object.assign(cell1.style, {
175-
// display: "flex",
176-
// flexDirection: "column",
177-
// alignItems: "center",
178-
// justifyContent: "center",
179-
// gap: "8px"
180-
// });
181-
182-
// const label = document.createElement("div");
183-
// label.textContent = name;
184-
// cell1.appendChild(label);
185-
186-
// targetCell = cell1;
187-
// } else {
188-
// cell1.style.width = ColWidth;
189-
// cell1.innerHTML = `${name} `;
190-
// targetCell = row.insertCell(1);
191-
// targetCell.style.width = ColWidth;
192-
// targetCell.classList.add("field");
193-
// // Also center the second cell in standard mode
194-
// targetCell.style.textAlign = "center";
195-
// }
196-
197-
// targetCell.style.textAlign = "center";
198-
199-
// // Button Container Alignment
200-
// const buttonGroup = document.createElement("div");
201-
// Object.assign(buttonGroup.style, {
202-
// display: "inline-flex",
203-
// flexDirection: "row",
204-
// alignItems: "center",
205-
// justifyContent: "center", // Ensures buttons stay centered in their row
206-
// gap: "4px"
207-
// });
208-
// targetCell.appendChild(buttonGroup);
209-
210-
// // Helper function
211-
// const createInp = (type, id, value, onclickVal) => {
212-
// const el = document.createElement("input");
213-
// el.type = type;
214-
// if (id) el.id = id;
215-
// if (value !== undefined) el.value = value;
216-
// if (onclickVal !== undefined) {
217-
// // Logic: button -> buttonGroup -> cell
218-
// el.setAttribute("onclick", `counter(this.parentElement.parentElement, ${onclickVal})`);
219-
// }
220-
// return el;
221-
// };
222-
223-
// // Build Button Group
224-
// if (data.plusInc1) buttonGroup.appendChild(createInp("button", `minusInc1_${data.code}`, -data.plusInc1, -data.plusInc1));
225-
// if (data.plusInc2) buttonGroup.appendChild(createInp("button", `minusInc2_${data.code}`, -data.plusInc2, -data.plusInc2));
226-
227-
// buttonGroup.appendChild(createInp("button", `minus_${data.code}`, "-", -1));
228-
229-
// const mainInp = createInp("text", `input_${data.code}`, 0);
230-
// mainInp.classList.add("counter");
231-
// mainInp.name = (enableGoogleSheets && data.gsCol) ? data.gsCol : data.code;
232-
// Object.assign(mainInp.style, {
233-
// backgroundColor: "black",
234-
// color: "white",
235-
// border: "none",
236-
// textAlign: "center",
237-
// width: "3ch",
238-
// });
239-
// mainInp.disabled = true;
240-
// mainInp.maxLength = 4;
241-
// buttonGroup.appendChild(mainInp);
242-
243-
// buttonGroup.appendChild(createInp("button", `plus_${data.code}`, "+", 1));
244-
245-
// if (data.plusInc2) buttonGroup.appendChild(createInp("button", `plusInc2_${data.code}`, `+${data.plusInc2}`, data.plusInc2));
246-
// if (data.plusInc1) buttonGroup.appendChild(createInp("button", `plusInc1_${data.code}`, `+${data.plusInc1}`, data.plusInc1));
247-
248-
// // Metadata
249-
// if (data.cycleTimer) {
250-
// const timer = createInp("hidden", `cycleTimer_${data.code}`, data.cycleTimer);
251-
// targetCell.appendChild(timer);
252-
// }
253-
254-
// if (data.hasOwnProperty('defaultValue')) {
255-
// const def = createInp("hidden", `default_${data.code}`, data.defaultValue);
256-
// targetCell.appendChild(def);
257-
// }
258-
259-
// // if (data.hasOwnProperty('cycleTimer')) {
260-
// // if (data.cycleTimer != "") {
261-
// // inp = document.createElement('input');
262-
// // inp.setAttribute("hidden", "");
263-
// // inp.setAttribute("id", "cycleTimer_" + data.code);
264-
// // inp.setAttribute("value", data.cycleTimer);
265-
// // cell.appendChild(inp);
266-
// // }
267-
// // }
268-
269-
// // if (data.hasOwnProperty('defaultValue')) {
270-
// // var def = document.createElement("input");
271-
// // def.setAttribute("id", "default_" + data.code)
272-
// // def.setAttribute("type", "hidden");
273-
// // def.setAttribute("value", data.defaultValue);
274-
// // cell2.appendChild(def);
275-
// // }
276-
277-
// return idx + 1;
278-
// }
279-
280151
function addCounter(table, idx, name, data) {
281152
const row = table.insertRow(idx);
282153
const hasExtraInc = data.hasOwnProperty('plusInc1') || data.hasOwnProperty('plusInc2');
@@ -310,7 +181,7 @@ function addCounter(table, idx, name, data) {
310181
// Create label
311182
const label = document.createElement("div");
312183
label.textContent = name;
313-
label.style.cssText = 'margin-bottom: 8px;';
184+
label.style.cssText = 'margin-bottom: 12px;';
314185
wrapper.appendChild(label);
315186

316187
titleCell.appendChild(wrapper);
@@ -1628,3 +1499,4 @@ window.onload = function () {
16281499

16291500

16301501

1502+

0 commit comments

Comments
 (0)