(force)
| 2493 | } |
| 2494 | |
| 2495 | function applyDualPaneMode(force) { |
| 2496 | let enabled = false; |
| 2497 | try { |
| 2498 | enabled = (typeof force === 'boolean') |
| 2499 | ? force |
| 2500 | : localStorage.getItem('dualPaneMode') === 'true'; |
| 2501 | } catch (e) { /* ignore */ } |
| 2502 | window.dualPaneEnabled = enabled; |
| 2503 | |
| 2504 | const shell = document.getElementById('fileListShell'); |
| 2505 | if (shell) shell.classList.toggle('dual-pane', enabled); |
| 2506 | |
| 2507 | const storedActive = (function () { |
| 2508 | try { return localStorage.getItem('activePane'); } catch (e) { return null; } |
| 2509 | })(); |
| 2510 | if (enabled) { |
| 2511 | setActivePane(storedActive === 'secondary' ? 'secondary' : 'primary', { skipStore: true, skipAutoLoad: true }); |
| 2512 | } else { |
| 2513 | setActivePane('primary', { skipStore: true, skipAutoLoad: true }); |
| 2514 | } |
| 2515 | |
| 2516 | const primaryPane = document.querySelector('.file-list-pane.primary-pane'); |
| 2517 | const secondaryPane = document.querySelector('.file-list-pane.secondary-pane'); |
| 2518 | if (enabled) { |
| 2519 | if (primaryPane) primaryPane.style.display = ''; |
| 2520 | if (secondaryPane) secondaryPane.style.display = ''; |
| 2521 | } else { |
| 2522 | if (primaryPane) primaryPane.style.display = ''; |
| 2523 | if (secondaryPane) secondaryPane.style.display = 'none'; |
| 2524 | if (primaryPane) primaryPane.classList.remove('fr-pane-active'); |
| 2525 | if (secondaryPane) secondaryPane.classList.remove('fr-pane-active'); |
| 2526 | } |
| 2527 | updatePaneWidthClasses(); |
| 2528 | updateDualPaneTargetHint(); |
| 2529 | } |
| 2530 | |
| 2531 | window.applyDualPaneMode = applyDualPaneMode; |
| 2532 |
no test coverage detected