mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 07:43:56 +08:00
update 2026-10-18 23:15:13
This commit is contained in:
1 parent
21a5be24ad
commit
98f89b4fef
3 files changed
+25
-9
No files matched your search
@@ -312,9 +312,22 @@ function applyDecision(t, d) {
|
||||
if (d.breakCol !== -1) markBreakColumn(t, t.querySelectorAll('.tr'), d.breakCol);
|
||||
}
|
||||
|
||||
/* A first cell with no break opportunity (no space, no hyphen: "/dev/mtdblock6") is marked so a carded half-cell can
|
||||
* widen to it: CSS cannot tell a token from a phrase, and `anywhere` cut it mid-word at 94-106px.
|
||||
* textContent reads no layout; the class is a function of the text, so a poll's identical copy gets
|
||||
* the same answer, and an unchanged mark is not rewritten (no mutation for the observers). */
|
||||
function markTokenCells(t) {
|
||||
t.querySelectorAll('.tr > .td:first-child').forEach((c) => {
|
||||
const txt = c.textContent.trim();
|
||||
const on = !!txt && !(/[\s\u002d\u00ad\u2010-\u2014]/).test(txt);
|
||||
if (c.classList.contains('fs-td-token') !== on) c.classList.toggle('fs-td-token', on);
|
||||
});
|
||||
}
|
||||
|
||||
function fitTables() {
|
||||
let cw;
|
||||
document.querySelectorAll(stackables()).forEach((t) => {
|
||||
markTokenCells(t);
|
||||
if (fit.scrolling() && t.classList.contains('fs-fitted')) {
|
||||
if (t._fsBreakCol >= 0) markBreakColumn(t, t.querySelectorAll('.tr'), t._fsBreakCol);
|
||||
return;
|
||||
@@ -560,6 +573,8 @@ function wireTypeahead() {
|
||||
return baseclass.extend({
|
||||
/* test-only: the slot-cache key, driven directly */
|
||||
shapeOf, /* fs:probe */
|
||||
/* test-only: the token-cell predicate */
|
||||
markTokenCells, /* fs:probe */
|
||||
|
||||
__init__() {
|
||||
wireTypeahead();
|
||||
|
||||
@@ -374,6 +374,10 @@
|
||||
.table.fs-stacked .td:not(.cbi-section-actions):not([class*="col-"]):not(:has(.cbi-progressbar)) {
|
||||
flex: 1 1 50% !important;
|
||||
}
|
||||
/* a first cell that is one token (fs-select.js): "/dev/mtdblock6" is 110px, the half-split left
|
||||
* 94-106px at 360-390 and `anywhere` cut it mid-word. fit-content of one token is the token,
|
||||
* capped at the row, so a 64-char hash still breaks inside the card; a phrase keeps its half. */
|
||||
.table.fs-stacked .tr > .td.fs-td-token:first-child:not(.cbi-section-actions):not([class*="col-"]) { min-width: fit-content; }
|
||||
/* a meter takes the whole line — its own title prints over the cell's caption otherwise */
|
||||
.table.fs-stacked .td:has(.cbi-progressbar) { flex: 1 1 100% !important; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user