Skip to content

Commit

Permalink
Merge pull request #25 from cagov/jbum-par-hidden
Browse files Browse the repository at this point in the history
Hide PAR block by default. Reveal it when URL parameter 'par' is present.
  • Loading branch information
jbum authored Jan 16, 2024
2 parents 5206561 + 156a488 commit 4163994
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/site/_includes/par-scores.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="page-score-info">
<div class="page-score-info" style="display:none">
<p>ODI grades the reading level, performance, and accessibility of all our webpages. Here are this page’s scores as of the last update:</p>
<!-- placeholder markup for now -->
<div class="score-display">
Expand Down Expand Up @@ -31,3 +31,11 @@
{% endif %}
</div>
</div>

<script>
// using URLSearchParam, if parameter 'par' is present then show the above page-score-info div
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('par')) {
document.querySelector('.page-score-info').style.display = 'block';
}
</script>

0 comments on commit 4163994

Please sign in to comment.