Skip to content

Commit

Permalink
run js async as dom loaded event
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Jan 27, 2025
1 parent b459419 commit 9bb3eb2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions asdf_website/_static/css/globalnav.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
padding-right: 1em;
}

.announcement-content a:hover {
color: fuchsia;
}
.announcement-content a:hover {
color: fuchsia;
}
6 changes: 3 additions & 3 deletions asdf_website/_static/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function hideHomePageAds(){
var rtdAd = document.getElementById(id="readthedocs-ea");
document.addEventListener('DOMContentLoaded', (event) => {
const rtdAd = document.getElementById("readthedocs-ea");
if (!rtdAd.hasAttribute("hidden")) {
rtdAd.setAttribute("hidden", "true");
}
}
});
2 changes: 1 addition & 1 deletion asdf_website/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,5 @@ <h2>Tutorials</h2>

</body>
<!-- Custom JS -->
<script src="{{ pathto('_static/js/custom.js', 1) }}">hideHomePageAds();</script>
<script async type="text/javascript" src="_static/js/custom.js"></script>
</html>

0 comments on commit 9bb3eb2

Please sign in to comment.