Skip to content

Commit

Permalink
Merge pull request #614 from City-of-Helsinki/UHF-7269_JS_fallback
Browse files Browse the repository at this point in the history
UHF-7269: JS fallback updates
  • Loading branch information
xkhaven authored Oct 19, 2023
2 parents 2e2a053 + 782104a commit ce004b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/helfi_toc/assets/js/tableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,15 @@
content.setAttribute('id', anchorName);
});

// Remove loading text.
if (tableOfContents) {
const removeElements = tableOfContents.querySelectorAll('.js-remove');
// Remove loading text and noscript element.
const removeElements = tableOfContents.parentElement.querySelectorAll('.js-remove');
removeElements.forEach(function (element) {
element.remove();
});

// Update toc visible.
tableOfContents.setAttribute('data-js', 'true');
}
},
};
Expand Down

0 comments on commit ce004b2

Please sign in to comment.