Skip to content

Commit 6f0f84a

Browse files
Fix multi-row docker preview default trigger wiring
1 parent 837074f commit 6f0f84a

6 files changed

Lines changed: 37 additions & 35 deletions

File tree

archive/folderview.plus-2026.04.04.01.txz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
760f0abd7ebc660b2770898400720b1b4db49730b52986a59d82f3b59887c0f3 folderview.plus-2026.04.04.26.txz

folderview.plus.plg

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

1313
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" icon="folder-icon.png" support="https://forums.unraid.net/topic/197631-plugin-folderview-plus/" min="7.0.0">
1414
<CHANGES>
1515

16+
###2026.04.04.26
17+
- Fix: Docker runtime rows, folder state, and container interactions.
18+
19+
1620
###2026.04.04.25
1721
- Fix: Multi-row Docker folder previews now proxy Default context clicks back to the native hidden container trigger, so the Docker menu works again when preview rows are set above 1 or Unlimited.
1822

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

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -979,36 +979,32 @@ const bindCompactPreviewDefaultContext = ($item, $sourceRow) => {
979979
if (!$nativeTrigger.length) {
980980
return;
981981
}
982-
$item
983-
.attr('data-fv-default-context-proxy', '1')
984-
.off('click.fvDockerCompactDefaultContext')
985-
.on('click.fvDockerCompactDefaultContext', (event) => {
986-
if ($(event.target).closest('.folder-element-custom-btn').length) {
987-
return;
988-
}
989-
event.preventDefault();
990-
event.stopPropagation();
991-
const nativeTrigger = $nativeTrigger.get(0);
992-
if (!nativeTrigger) {
993-
return;
994-
}
995-
const clickEvent = $.Event('click');
996-
try {
997-
$(nativeTrigger).trigger(clickEvent);
998-
} catch (_error) {
999-
// Fall back to the native click path below.
1000-
}
1001-
if (clickEvent.isDefaultPrevented()) {
1002-
return;
1003-
}
1004-
try {
1005-
if (typeof nativeTrigger.click === 'function') {
1006-
nativeTrigger.click();
1007-
}
1008-
} catch (_error) {
1009-
// Ignore native click fallbacks when the host row rejects programmatic clicks.
1010-
}
1011-
});
982+
const inlineClick = String($nativeTrigger.attr('onclick') || '').trim();
983+
const inlineContextMenu = String($nativeTrigger.attr('oncontextmenu') || '').trim();
984+
const title = String($nativeTrigger.attr('title') || '').trim();
985+
const targets = [
986+
$item,
987+
$item.find('.hand').first(),
988+
$item.find('.inner').first(),
989+
$item.find('span.appname').first(),
990+
$item.find('span.appname > a.exec').first()
991+
].filter(($target) => $target && $target.length);
992+
targets.forEach(($target) => {
993+
$target.addClass('hand');
994+
if (inlineClick) {
995+
$target.attr('onclick', inlineClick);
996+
}
997+
if (inlineContextMenu) {
998+
$target.attr('oncontextmenu', inlineContextMenu);
999+
}
1000+
if (title) {
1001+
$target.attr('title', title);
1002+
}
1003+
});
1004+
const $appLink = $item.find('span.appname > a.exec').first();
1005+
if ($appLink.length && !$appLink.attr('href')) {
1006+
$appLink.attr('href', '#');
1007+
}
10121008
};
10131009
const decorateDockerFolderMemberRow = ($row, folderId, containerName) => {
10141010
if (!$row || !$row.length) {

tests/docker-preview-overflow-feature.test.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ test('docker runtime applies preview row layout limits and keeps compact preview
5151
assert.match(dockerJs, /const buildDockerPreviewItem = \(\{ entry = \{\}, settings = \{\}, autostart = false \}\) =>/);
5252
assert.match(dockerJs, /const bindCompactPreviewDefaultContext = \(\$item, \$sourceRow\) =>/);
5353
assert.match(dockerJs, /\$sourceRow\.find\('td\.ct-name > span\.outer > span\.hand'\)\.first\(\)/);
54-
assert.match(dockerJs, /\.on\('click\.fvDockerCompactDefaultContext', \(event\) => \{/);
55-
assert.match(dockerJs, /\$\(nativeTrigger\)\.trigger\(clickEvent\);/);
54+
assert.match(dockerJs, /const inlineClick = String\(\$nativeTrigger\.attr\('onclick'\) \|\| ''\)\.trim\(\);/);
55+
assert.match(dockerJs, /const targets = \[/);
56+
assert.match(dockerJs, /\$target\.addClass\('hand'\);/);
57+
assert.match(dockerJs, /\$target\.attr\('onclick', inlineClick\);/);
5658
assert.match(dockerJs, /fv-docker-preview-mode-2 fv-preview-trigger fv-preview-tooltip-proxy/);
5759
assert.match(dockerJs, /fv-docker-preview-mode-\$\{previewMode\} fv-preview-trigger fv-preview-tooltip-proxy/);
5860
assert.match(dockerJs, /fv-docker-preview-mode-1 fv-preview-trigger fv-preview-tooltip-proxy/);

0 commit comments

Comments
 (0)