Re-clamp recent panel when queue view layout changes
The recent-files panel was only clamped on window resize and tab switches. When the queue toolbar wrapped to a second row afterwards, the queue could shrink below its minimum height. Observe the queue shell and its fixed rows and re-clamp on size changes.
This commit is contained in:
1 parent
2810ff8d98
commit
a6fa9b04dc
1 file changed
+13
-2
+13
-2
@@ -10282,10 +10282,21 @@ function showCopyToast(msg, durationMs) {
|
||||
if (Math.abs(nextHeight - requestedHeight) > 0.5) panel.style.flex = `0 0 ${nextHeight}px`;
|
||||
};
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
const scheduleRecentPanelClamp = () => {
|
||||
window.cancelAnimationFrame(resizeFrame);
|
||||
resizeFrame = window.requestAnimationFrame(clampRecentPanelHeight);
|
||||
});
|
||||
};
|
||||
|
||||
window.addEventListener('resize', scheduleRecentPanelClamp);
|
||||
|
||||
const shell = panel.closest('.queue-shell');
|
||||
if (shell && typeof window.ResizeObserver === 'function') {
|
||||
const shellLayoutObserver = new window.ResizeObserver(scheduleRecentPanelClamp);
|
||||
shellLayoutObserver.observe(shell);
|
||||
for (const element of shell.children) {
|
||||
if (element !== panel && element.id !== 'queueContainer') shellLayoutObserver.observe(element);
|
||||
}
|
||||
}
|
||||
|
||||
resizer.addEventListener('mousedown', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user