Skip to content

Commit 34962ac

Browse files
Fix docker folder row vertical centering in fixed table layout
1 parent 4cc13e2 commit 34962ac

5 files changed

Lines changed: 66 additions & 5 deletions

File tree

208 KB
Binary file not shown.
208 KB
Binary file not shown.

folderview.plus.plg

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,24 @@
66
<!ENTITY launch "Settings/FolderViewPlus">
77
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
88
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/main/folderview.plus.plg">
9-
<!ENTITY version "2026.03.07.6">
10-
<!ENTITY md5 "d1e68142243a2b2e574d2ccb928dc34e">
9+
<!ENTITY version "2026.03.07.8">
10+
<!ENTITY md5 "afea9c4354cc2b161a80161aecc791dd">
1111
]>
1212

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-open-o" support="https://github.com/alexphillips-dev/FolderView-Plus/issues" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.03.07.8
17+
- Fix Docker folder row vertical alignment in fixed/clone table layouts:
18+
- widen centering selectors to all folder rows instead of only `#docker_list`,
19+
- apply runtime centering styles to every matching folder row copy after render.
20+
21+
###2026.03.07.7
22+
- Add runtime-enforced Docker folder row alignment fallback in `docker.js`:
23+
- apply inline `vertical-align: middle !important` to folder row cells after render,
24+
- force left folder cell content block to centered positioning after insertion and after full folder build.
25+
- Keep CSS centering rules in place, with JS fallback overriding any theme/custom style collisions.
26+
1627
###2026.03.07.6
1728
- Rework Docker folder left-cell vertical centering using explicit in-cell absolute centering, avoiding inherited top alignment from Unraid table styles.
1829

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/scripts/docker.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,50 @@ if (FOLDER_VIEW_DEBUG_MODE) {
5656
console.log('[FV3_DEBUG] docker.js loaded. FOLDER_VIEW_DEBUG_MODE is ON.');
5757
}
5858

59+
const escapeClassToken = (value) => {
60+
const input = String(value);
61+
if (window.CSS && typeof window.CSS.escape === 'function') {
62+
return window.CSS.escape(input);
63+
}
64+
return input.replace(/[^a-zA-Z0-9_-]/g, '\\$&');
65+
};
66+
67+
const forceFolderRowVerticalCenter = (id) => {
68+
const escapedId = escapeClassToken(id);
69+
const rows = Array.from(document.querySelectorAll(`tr.folder.folder-id-${escapedId}`));
70+
if (!rows.length) {
71+
return;
72+
}
73+
74+
rows.forEach((row) => {
75+
Array.from(row.children).forEach((td) => {
76+
if (td && td.tagName === 'TD') {
77+
td.style.setProperty('vertical-align', 'middle', 'important');
78+
}
79+
});
80+
81+
const cell = row.querySelector('td.ct-name.folder-name');
82+
if (!cell) {
83+
return;
84+
}
85+
cell.style.setProperty('position', 'relative', 'important');
86+
cell.style.setProperty('padding-top', '0px', 'important');
87+
cell.style.setProperty('padding-bottom', '0px', 'important');
88+
89+
const sub = cell.querySelector('.folder-name-sub');
90+
if (!sub) {
91+
return;
92+
}
93+
sub.style.setProperty('position', 'absolute', 'important');
94+
sub.style.setProperty('top', '50%', 'important');
95+
sub.style.setProperty('left', '8px', 'important');
96+
sub.style.setProperty('right', '8px', 'important');
97+
sub.style.setProperty('transform', 'translateY(-50%)', 'important');
98+
sub.style.setProperty('display', 'flex', 'important');
99+
sub.style.setProperty('align-items', 'center', 'important');
100+
});
101+
};
102+
59103
/**
60104
* Handles the creation of all folders
61105
*/
@@ -224,6 +268,11 @@ const createFolders = async () => {
224268
globalFolders = foldersDone;
225269
if (FOLDER_VIEW_DEBUG_MODE) console.log('[FV3_DEBUG] createFolders: Assigned foldersDone to globalFolders:', {...globalFolders});
226270

271+
Object.keys(globalFolders).forEach((folderId) => forceFolderRowVerticalCenter(folderId));
272+
setTimeout(() => {
273+
Object.keys(globalFolders).forEach((folderId) => forceFolderRowVerticalCenter(folderId));
274+
}, 50);
275+
227276
folderDebugMode = false; // Existing flag
228277
if (FOLDER_VIEW_DEBUG_MODE) console.log('[FV3_DEBUG] createFolders: Set folderDebugMode (existing) to false.');
229278

@@ -376,6 +425,7 @@ const createFolder = (folder, id, positionInMainOrder, liveOrderArray, container
376425
$('#docker_list').append($(fld));
377426
}
378427
}
428+
forceFolderRowVerticalCenter(id);
379429

380430
// NOTE: switchButton initialization is deferred until after autostart state is known (see below).
381431
// This avoids the bug where initializing with checked:false then clicking ON could

src/folderview.plus/usr/local/emhttp/plugins/folderview.plus/styles/docker.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
}
2929

3030
/* Keep folder rows vertically centered against the preview row content */
31-
#docker_list > tr.sortable.folder > td {
31+
tr.folder > td {
3232
vertical-align: middle !important;
3333
}
3434

3535
/* Unraid table styles can force top visual placement.
3636
Center the left folder block explicitly within the row height. */
37-
#docker_list > tr.sortable.folder > td.ct-name.folder-name {
37+
tr.folder > td.ct-name.folder-name {
3838
position: relative;
3939
padding-top: 0 !important;
4040
padding-bottom: 0 !important;
4141
}
4242

43-
#docker_list > tr.sortable.folder > td.ct-name.folder-name > .folder-name-sub {
43+
tr.folder > td.ct-name.folder-name > .folder-name-sub {
4444
position: absolute;
4545
top: 50%;
4646
left: 8px;

0 commit comments

Comments
 (0)