fix: serve bootstrap locally, fix modal button null reference

- Replace CDN bootstrap with local /lib/bootstrap/ - CDN SRI hash was
  mismatching and blocking the script entirely (no Bootstrap = no modals)
- Fix addEventListener null error: script runs before @section FormActions
  renders the button, so use document-level event delegation instead

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anatolii Grynchuk
2026-05-02 03:45:20 +03:00
parent 7587e7fd17
commit 6434e3e636
4 changed files with 19 additions and 9 deletions
@@ -158,8 +158,10 @@
</div>
<script>
document.getElementById('testModalBtn').addEventListener('click', function () {
bootstrap.Modal.getOrCreateInstance(document.getElementById('testModal')).show();
document.addEventListener('click', function (e) {
if (e.target.closest('#testModalBtn')) {
bootstrap.Modal.getOrCreateInstance(document.getElementById('testModal')).show();
}
});
async function sendTestEmail(channelId) {