Skip to content

Commit

Permalink
Include legacy repo scripts in review app legacy mode
Browse files Browse the repository at this point in the history
This will allow us to test compatibility with GOV.UK Frontend
scripts and to diagnose issues such as
#1270

Co-authored-by: Nick Colley <[email protected]>
  • Loading branch information
2 people authored and aliuk2012 committed Jun 14, 2019
1 parent 2e0887f commit 7ea655c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions app/views/layouts/_generic.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,39 @@
{% endblock %}

{% block bodyEnd %}

{% if legacy %}
<script src="/vendor/govuk_template/javascripts/govuk-template.js"></script>

{# Frontend Toolkit dependency #}
<script src="/vendor/jquery/jquery.min.js"></script>
{# Frontend Toolkit modules #}
<script src="/vendor/govuk_frontend_toolkit/details.polyfill.js"></script>
<script src="/vendor/govuk_frontend_toolkit/modules.js"></script>
<script src="/vendor/govuk_frontend_toolkit/modules/auto-track-event.js"></script>
<script src="/vendor/govuk_frontend_toolkit/primary-links.js"></script>
<script src="/vendor/govuk_frontend_toolkit/shim-links-with-button-role.js"></script>
<script src="/vendor/govuk_frontend_toolkit/show-hide-content.js"></script>
<script src="/vendor/govuk_frontend_toolkit/stick-at-top-when-scrolling.js"></script>
<script src="/vendor/govuk_frontend_toolkit/stop-scrolling-at-footer.js"></script>

<script>
(function() {
// Instantiate Frontend Toolkit modules
// Ordering follows what we do in test manifest: /spec/manifest.js
GOVUK.details.init()
GOVUK.modules.start()
GOVUK.primaryLinks.init()
var showHideContent = new GOVUK.ShowHideContent()
showHideContent.init()
GOVUK.stickAtTopWhenScrolling.init()
GOVUK.shimLinksWithButtonRole.init()
})()
</script>
{% endif %}

<script src="/public/all.js"></script>
<script>window.GOVUKFrontend.initAll()</script>
{% endblock %}

0 comments on commit 7ea655c

Please sign in to comment.