mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
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
This commit is contained in:
18
app/assets/javascripts/dropdown.js
Normal file
18
app/assets/javascripts/dropdown.js
Normal file
@@ -0,0 +1,18 @@
|
||||
(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);
|
||||
Reference in New Issue
Block a user