diff --git a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js index ae105e822..fdd64be8b 100644 --- a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js +++ b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js @@ -1 +1 @@ -!function(){"use strict";!function(Drupal,e){Drupal.behaviors.updating_news_table_of_contents={attach:function(){const t=document.getElementById("helfi-toc-table-of-contents-news-updates");if(!t)return;const n=document.querySelector("#helfi-toc-table-of-contents-list > ul"),o=document.querySelector("main.layout-main-wrapper");document.querySelectorAll("[id]").forEach((function(e){Drupal.tableOfContents.reservedIds.push(e.id)}));let l=Drupal.tableOfContents.exclusions();l+=":not(.components--upper *):not(.component--remote-video *):not(.component--text *):not(.component--banner *):not(.component--image *):not(.block--news-of-interest *):not(#helfi-toc-table-of-contents-news-updates *)",e("updating-news-table-of-contents",Drupal.tableOfContents.titleComponents(l).join(","),o).forEach((function(e){const{nodeName:o,anchorName:l}=Drupal.tableOfContents.createTableOfContentElements(e,[]);let a="";if(t&&e.nextSibling&&"TIME"===e.nextElementSibling.nodeName){let t=new Date(e.nextElementSibling.dateTime);a=`${t.getDate()}.${t.getMonth()+1}.${t.getFullYear()}`}if(n&&"h2"===o){let t=document.createElement("li");if(t.classList.add("table-of-contents__item"),a){let n=document.createElement("time");n.dateTime=e.nextElementSibling.dateTime,n.textContent=a,t.appendChild(n)}let o=document.createElement("a");o.classList.add("table-of-contents__link"),o.href=`#${l}`,o.textContent=e.textContent.trim(),t.appendChild(o),n.appendChild(t)}})),t&&Drupal.tableOfContents.updateTOC(t)}}}(Drupal,once)}(); \ No newline at end of file +!function(){"use strict";!function(Drupal,e){Drupal.behaviors.updating_news_table_of_contents={attach:function(){const t=document.getElementById("helfi-toc-table-of-contents-news-updates");if(!t)return;const n=document.querySelector("#helfi-toc-table-of-contents-list > ul"),o=document.querySelector("main.layout-main-wrapper");document.querySelectorAll("[id]").forEach((function(e){Drupal.tableOfContents.reservedIds.push(e.id)}));let a=Drupal.tableOfContents.exclusions();a+=":not(.components--upper *):not(.component--remote-video *):not(.component--paragraph-text *):not(.component--banner *):not(.component--image *):not(.block--news-of-interest *):not(#helfi-toc-table-of-contents-news-updates *)",e("updating-news-table-of-contents",Drupal.tableOfContents.titleComponents(a).join(","),o).forEach((function(e){const{nodeName:o,anchorName:a}=Drupal.tableOfContents.createTableOfContentElements(e,[]);let l="";if(t&&e.nextSibling&&"TIME"===e.nextElementSibling.nodeName){let t=new Date(e.nextElementSibling.dateTime);l=`${t.getDate()}.${t.getMonth()+1}.${t.getFullYear()}`}if(n&&"h2"===o){let t=document.createElement("li");if(t.classList.add("table-of-contents__item"),l){let n=document.createElement("time");n.dateTime=e.nextElementSibling.dateTime,n.textContent=l,t.appendChild(n)}let o=document.createElement("a");o.classList.add("table-of-contents__link"),o.href=`#${a}`,o.textContent=e.textContent.trim(),t.appendChild(o),n.appendChild(t)}})),t&&Drupal.tableOfContents.updateTOC(t)}}}(Drupal,once)}(); \ No newline at end of file diff --git a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js index c6b0b6c40..ad376ec74 100644 --- a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js +++ b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js @@ -19,11 +19,12 @@ }); let exclusions = Drupal.tableOfContents.exclusions(); - // Add exclusions for the news updates table of contents. + // Add exclusions for the news updates table of contents. NOTICE: The text paragraph is the only one that + // has paragraph as a prefix, so it might look a bit silly compared to the other selectors. exclusions += ':not(.components--upper *)' + ':not(.component--remote-video *)' + - ':not(.component--text *)' + + ':not(.component--paragraph-text *)' + ':not(.component--banner *)' + ':not(.component--image *)' + ':not(.block--news-of-interest *)' +