Skip to content

Commit

Permalink
chore(docs-framework): add class on example load (patternfly#3789)
Browse files Browse the repository at this point in the history
* chore(docs-framework): add class on example load

* chore(example): remove dev mode check from page loaded class addition

* chore(example): refactor to add class on page load event
  • Loading branch information
wise-king-sullyman authored and edonehoo committed Nov 17, 2023
1 parent 30ce913 commit 6e87200
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export const Example = ({
}) => {
if (isFullscreenPreview) {
isFullscreen = false;
window.addEventListener('load', () => {
//append a class to the document body to indicate to screenshot/automated visual regression tools that the page has loaded
document.body.classList.add('page-loaded');
});
}
if (!lang) {
// Inline code
Expand Down

0 comments on commit 6e87200

Please sign in to comment.