From d7d00895b0d31c5b37838cf1387d442c92b3e013 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Wed, 29 May 2024 11:04:54 +0900 Subject: [PATCH] =?UTF-8?q?dialog=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/resources/js/base/base.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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);