From f3e950d7e6ac2992f85d8be247a7e45b78f98262 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Wed, 29 May 2024 11:06:28 +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 7de04e5..0c927dc 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", @@ -159,6 +170,7 @@ var dialog = { setTimeout(function(){dialog.close(id);}, conf.timeout); } + last.setZIndex(dlg, 10); dlg.draggable().modal("show"); $(".modal-backdrop").each(function() { // gives id to its backdrop let backdrop = $(this);