Sha256: 4bc3f5ed0a997d64bda471df3ff8ab9507c4b3565e9cefdfd1f0879896ce2d8a
Contents?: true
Size: 837 Bytes
Versions: 42
Compression:
Stored size: 837 Bytes
Contents
(function ($, Modules) { 'use strict' Modules.Navigation = function () { var $html = $('html') var $navToggle var $nav this.start = function ($element) { $navToggle = $('.js-nav-toggle', $element) $nav = $('.js-nav', $element) updateAriaAttributes() $navToggle.on('click', toggleNavigation) $(window).on('resize', updateAriaAttributes) } function updateAriaAttributes () { var navIsVisible = $nav.is(':visible') $navToggle.attr('aria-expanded', navIsVisible ? 'true' : 'false') $nav.attr('aria-hidden', navIsVisible ? 'false' : 'true') } function toggleNavigation () { var navIsVisible = !$html.hasClass('nav-open') $html.toggleClass('nav-open', navIsVisible) updateAriaAttributes() } } })(jQuery, window.GOVUK.Modules)
Version data entries
42 entries across 42 versions & 1 rubygems