Skip to content

Commit

Permalink
fix blacked out bug after closing all modals and reopening them
Browse files Browse the repository at this point in the history
  • Loading branch information
skylenet committed Oct 14, 2024
1 parent 0a5bd1e commit 366885c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static/js/common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Fix bootstrap backdrop stacking when having multiple modals
$(document).on('show.bs.modal', '.modal', function() {
const zIndex = 1040 + 10 * $('.modal:visible').length;
const zIndex = 10 + Math.max(...Array.from(document.querySelectorAll('*')).map((el) => +el.style.zIndex));
$(this).css('z-index', zIndex);
setTimeout(() => $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'));
});

0 comments on commit 366885c

Please sign in to comment.