app/views/layouts/govuk_template.html.erb in govuk_template-0.18.1 vs app/views/layouts/govuk_template.html.erb in govuk_template-0.18.2
- old
+ new
@@ -99,7 +99,10 @@
<div id="global-app-error" class="app-error hidden"></div>
<script src="<%= asset_path "govuk-template.js" %>"></script>
<%= yield :body_end %>
+
+ <%# if no GOVUK-namespaced module has loaded we can assume JS has failed and remove the class %>
+ <script>if (typeof window.GOVUK === 'undefined') document.body.className = document.body.className.replace('js-enabled', '');</script>
</body>
</html>