Sha256: fabac3b53837c34c2932144245883e7f157529983d64e564d436c12304178853
Contents?: true
Size: 621 Bytes
Versions: 50
Compression:
Stored size: 621 Bytes
Contents
/** * Helper class for internationalization event handling */ export default class InternationalizationHelper { constructor() { this.addLangClickListener(); } /** * Handle the event of selecting a new language from top bar, language select element. * This updates the html@lang attribute, which is important for screen readers */ addLangClickListener() { $('#user_utility_links') .find('a.dropdown-item') .on('click', e => { let locale = e.target.dataset['locale']; if (!locale) { return; } $('html').attr('lang', locale); }); } }
Version data entries
50 entries across 50 versions & 1 rubygems