Files
notifications-admin/app/assets/javascripts/dropdown.js
Chris Hill-Scott 4cb535a2e1 Add progressive enhancement to service switcher
- by default, the menu is open
- if Javascript is enabled/loaded, the links are hidden, and visual cues (▶) to
  show that it can be opened are added
- clicking it opens and closes it
2016-01-12 11:47:02 +00:00

19 lines
306 B
JavaScript

(function(Modules) {
"use strict";
Modules.Dropdown = function() {
this.start = function(component) {
$('.dropdown-toggle', component)
.on(
'click', () => $(component).toggleClass('js-closed')
)
.trigger('click');
};
};
})(window.GOVUK.Modules);