Skip to content

Commit 3e09eca

Browse files
GrabowskiMKamilSznajdrowicz
authored andcommitted
temp
1 parent 07e8494 commit 3e09eca

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/bundle/Resources/public/js/scripts/helpers/modal.helper.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,26 @@ const controlZIndex = (container) => {
1111
document.body.dispatchEvent(new CustomEvent('ibexa-control-z-index:events-attached'));
1212
};
1313

14-
const betterControlZIndex = (containers, listenerContainer, resetedZIndex = 'initial') => {
14+
const betterControlZIndex = (items, listenerContainer) => {
1515
const listenersAbortController = new AbortController();
1616
const containersInitialZIndexes = new Map();
1717
const removeControlZIndexListeners = () => {
1818
listenersAbortController.abort();
1919
listenerContainer.dispatchEvent(new CustomEvent('ibexa-control-z-index:events-detached'));
2020
}
2121

22-
containers.forEach((container) => {
22+
items.forEach(({ container }) => {
2323
containersInitialZIndexes.set(container, container.style.zIndex);
2424
});
2525

26-
containers.forEach((container) => {
27-
listenerContainer.addEventListener('show.bs.modal', () => {
28-
container.style.zIndex = resetedZIndex;
26+
listenerContainer.addEventListener('show.bs.modal', () => {
27+
items.forEach(({ container, zIndex = 'initial' }) => {
28+
container.style.zIndex = zIndex;
2929
});
30-
});
31-
32-
// listenerContainer.addEventListener('show.bs.modal', () => {
33-
// containers.forEach((container) => {
34-
// container.style.zIndex = resetedZIndex;
35-
// });
36-
// }, { signal: listenersAbortController.signal });
30+
}, { signal: listenersAbortController.signal });
3731

3832
listenerContainer.addEventListener('hidden.bs.modal', () => {
39-
containers.forEach((container) => {
33+
items.forEach(({ container }) => {
4034
container.style.zIndex = containersInitialZIndexes.get(container);
4135
});
4236
}, { signal: listenersAbortController.signal });

0 commit comments

Comments
 (0)