mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 16:44:45 +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();
|
||||
|
||||
Reference in new issue
Block a user