mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-07 17:22:57 +02:00
fix(regions): dim Manage Channels modal when region picker opens on top
Bump the picker modal's z-index (1075) and its backdrop (1065) above the underlying Manage Channels modal (1055) so the two layers visually separate instead of blending together. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3005,6 +3005,22 @@ async function openRegionPicker(channelIdx) {
|
||||
renderRegionPickerList();
|
||||
|
||||
const modalEl = document.getElementById('regionPickerModal');
|
||||
// Stacked-modal fix: when opened on top of Manage Channels, bump z-index so
|
||||
// the new backdrop dims the channels modal underneath instead of sliding behind it.
|
||||
const onShown = () => {
|
||||
const backdrops = document.querySelectorAll('.modal-backdrop');
|
||||
if (backdrops.length > 1) {
|
||||
modalEl.style.zIndex = '1075';
|
||||
backdrops[backdrops.length - 1].style.zIndex = '1065';
|
||||
}
|
||||
};
|
||||
const onHidden = () => {
|
||||
modalEl.style.zIndex = '';
|
||||
modalEl.removeEventListener('shown.bs.modal', onShown);
|
||||
modalEl.removeEventListener('hidden.bs.modal', onHidden);
|
||||
};
|
||||
modalEl.addEventListener('shown.bs.modal', onShown);
|
||||
modalEl.addEventListener('hidden.bs.modal', onHidden);
|
||||
bootstrap.Modal.getOrCreateInstance(modalEl).show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user