diff --git a/src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Suggestions.cshtml b/src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Suggestions.cshtml index 900686af..bab405b1 100644 --- a/src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Suggestions.cshtml +++ b/src/Geta.NotFoundHandler.Admin/Areas/GetaNotFoundHandlerAdmin/Pages/Suggestions.cshtml @@ -81,7 +81,7 @@
-
diff --git a/src/Geta.NotFoundHandler.Admin/wwwroot/GetaNotFoundHandlerAdmin/js/dashboard.js b/src/Geta.NotFoundHandler.Admin/wwwroot/GetaNotFoundHandlerAdmin/js/dashboard.js index 8b020460..a2f3c940 100644 --- a/src/Geta.NotFoundHandler.Admin/wwwroot/GetaNotFoundHandlerAdmin/js/dashboard.js +++ b/src/Geta.NotFoundHandler.Admin/wwwroot/GetaNotFoundHandlerAdmin/js/dashboard.js @@ -1,16 +1,15 @@ /* globals feather:false */ -(function() { +(function () { 'use strict'; feather.replace(); - function clearInput() { var initiators = document.querySelectorAll('[data-clear]'); - initiators.forEach(function(initiator) { + initiators.forEach(function (initiator) { initiator.addEventListener('click', - function(e) { + function (e) { var target = e.currentTarget; var selector = target.getAttribute('data-clear'); var input = document.querySelector(selector); @@ -21,7 +20,7 @@ function confirmSubmit() { var initiators = document.querySelectorAll('[data-confirm]'); - initiators.forEach(function(initiator) { + initiators.forEach(function (initiator) { var form = initiator.form; form.addEventListener('submit', function (e) { @@ -36,6 +35,23 @@ }); } + function adjustModalPosition() { + var modalTriggers = document.querySelectorAll('.modal-trigger[data-bs-target]'); + modalTriggers.forEach(function (modalTrigger) { + modalTrigger.addEventListener('click', function () { + var modalDialog = document.querySelector(modalTrigger.dataset.bsTarget + " .modal-dialog"); + if (!modalDialog) { return; } + + modalDialog.style = "position: fixed;" + + "top: " + modalTrigger.getBoundingClientRect().top + "px;" + + "left: 50%;" + + "min-width: 500px;" + + "transform: translate(-50%, -50%);"; + }); + }); + } + clearInput(); confirmSubmit(); -})() \ No newline at end of file + adjustModalPosition(); +})()