diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 38c6d5be46..0952e98057 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -190,14 +190,24 @@ $("#noticestable").on("click", ".notice-title", function (e) { e.preventDefault(); var title = $(this).text(); + $("#noticeModalLabel").text(title); + var noticeid = $(this).data("noticeid"); - var body = $("#notice" + noticeid).attr("srcdoc"); + + // Use shadow DOM for notice content preview + var srcdoc = $("#notice" + noticeid).attr("srcdoc"); + var shadowHost = document.createElement("div"); + var shadowRoot = shadowHost.attachShadow({ mode: "open" }); + shadowRoot.innerHTML = srcdoc; + + $("#noticeModal .modal-body").html(""); + $("#noticeModal .modal-body")[0].appendChild(shadowHost); + if ($("#resend_notice" + noticeid).length) { + $("#resend-notice").data("noticeid", noticeid); $("#resend-notice").show(); } - $("#resend-notice").data("noticeid", noticeid); - $("#noticeModalLabel").text(title); - $("#noticeModal .modal-body").html(body); + $("#noticeModal").modal("show"); });