From c10eb29ac1d36042b6de54497b7b179ac222b4f5 Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Tue, 15 Oct 2024 15:54:30 +0200 Subject: [PATCH] fixup modal zindex --- static/js/explorer.js | 5 +++-- templates/clients/clients_cl.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/explorer.js b/static/js/explorer.js index ab4731a..83372c3 100644 --- a/static/js/explorer.js +++ b/static/js/explorer.js @@ -17,9 +17,10 @@ function modalFixes() { // Fix bootstrap backdrop stacking when having multiple modals $(document).on('show.bs.modal', '.modal', function() { - const zIndex = 2000; + const offset = (10 * $('.modal:visible').length); + const zIndex = 2000 + offset; $(this).css('z-index', zIndex); - setTimeout(() => $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack')); + setTimeout(() => $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - offset - 1).addClass('modal-stack')); }); // Fix bootstrap scrolling stacking when having multiple modals $(document).on('hidden.bs.modal', '.modal', function(){ diff --git a/templates/clients/clients_cl.html b/templates/clients/clients_cl.html index 0153293..9fe49b7 100644 --- a/templates/clients/clients_cl.html +++ b/templates/clients/clients_cl.html @@ -116,7 +116,7 @@