file manager: tree height fits the free viewport space (sw otaman-v175)
The tree box was capped at a fixed 65vh, which ignored the chrome above it (header, tabs, status, sub-tabs, sort/probe row), so the page itself grew a scrollbar once the tree hit its cap. pysimFsFitTree() now caps it to innerHeight - top - 12px at runtime (the inline 65vh stays as the no-JS fallback), re-run on resize, on render, on sub-tab/tab entry and when the probe status line appears.
This commit is contained in:
@@ -22,7 +22,7 @@ function extractFunc(src, name) {
|
||||
}
|
||||
|
||||
let code = 'var pysimFsTreeRoot = null;\nvar _pysimFsProbe = null;\nvar pysimFsSort = "fid";\n';
|
||||
for (const fn of ['getParentSel', 'getParentPath', 'pysimFsSortChildren', 'pysimFsLoadChildren', 'pysimFsSelectBody', 'pysimFsProbeUi', 'pysimFsProbeAll']) {
|
||||
for (const fn of ['getParentSel', 'getParentPath', 'pysimFsSortChildren', 'pysimFsLoadChildren', 'pysimFsSelectBody', 'pysimFsFitTree', 'pysimFsProbeUi', 'pysimFsProbeAll']) {
|
||||
code += extractFunc(html, fn) + '\n';
|
||||
}
|
||||
code += 'globalThis.esc = s => s;\nglobalThis.t = s => s;\nglobalThis.pysimCustomInject = () => {};\n';
|
||||
|
||||
@@ -95,6 +95,10 @@ test('file manager keeps sort/probe controls above the scrolling tree', () => {
|
||||
assert.ok(html.indexOf('id="pysim-fs-probe-btn"') < html.indexOf('id="pysim-fs-tree"'));
|
||||
assert.ok(html.indexOf('pysim-fs-sort-pill') < html.indexOf('id="pysim-fs-tree"'));
|
||||
assert.match(html, /style="max-height:65vh"[^>]*>\s*<div id="pysim-fs-tree">/);
|
||||
// the runtime fit caps it to the free viewport space; 65vh stays only as
|
||||
// the no-JS fallback
|
||||
assert.match(html, /function pysimFsFitTree\(/);
|
||||
assert.match(html, /addEventListener\('resize', pysimFsFitTree\)/);
|
||||
});
|
||||
|
||||
test('custom-files init runs after the language init', () => {
|
||||
|
||||
Reference in New Issue
Block a user