diff --git a/src/main/webapp/resources/js/base/base.js b/src/main/webapp/resources/js/base/base.js index be756fe3..20c93c21 100644 --- a/src/main/webapp/resources/js/base/base.js +++ b/src/main/webapp/resources/js/base/base.js @@ -119,6 +119,17 @@ var dialog = { $("#close" + id).click(); }, create:function(conf) { + let last = { + dlg: $("div.modal.show").last()[0], + exists: () => last.dlg, + setZIndex: (obj, offset) => { + if (!last.exists()) return; + + let zIndex = Number($(last.dlg).css("z-index")); + obj.css("z-index", zIndex + offset); + } + }; + conf = conf || {}; let id = conf.id || "dlg-" + uuid(), backdropID = id + "-backdrop", @@ -160,6 +171,7 @@ var dialog = { setTimeout(function(){dialog.close(id);}, conf.timeout); } + last.setZIndex(dlg, 10); dlg.modal("show"); $(".modal-backdrop").each(function() { // gives id to its backdrop let backdrop = $(this);