diff options
Diffstat (limited to '_layouts/postlist.html')
-rw-r--r-- | _layouts/postlist.html | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/_layouts/postlist.html b/_layouts/postlist.html index b6b29ef..24909d1 100644 --- a/_layouts/postlist.html +++ b/_layouts/postlist.html @@ -57,31 +57,4 @@ layout: default </div> -<script> - document.addEventListener("DOMContentLoaded", function() { - {%- assign news_ids = site.data.news | map: 'id' | jsonify %} - - const ids = {{ news_ids }}; - for (currId of ids) { - const currentBanner = document.getElementById(currId); - if (!currentBanner) { - continue; - } - const closeLink = currentBanner.firstElementChild; - const currentNewsClosed = localStorage.getItem(currId+"closed"); - if (currentNewsClosed === "true") { - currentBanner.style.display = "none"; - } - - function closeBanner(evt) { - currentBanner.style.display = "none"; - const storId = evt.currentTarget.closeArg + "closed"; - localStorage.setItem(storId, "true"); - } - - closeLink.closeArg=currId; - closeLink.addEventListener("click", closeBanner); - } - - }); -</script> +<script src="/assets/js/newsbanner.js"></script> |