mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
82a62cd2ed
* CSS for moving from a horizontal main menu to a side/vertical one * Add <App /> Component and rearrange <HashcorpConsul /> to use it 1. HashicorpConsul now uses <App /> 2. <App /> is now translated and adds 'skip to main content' functionality 3. Adds ember-in-viewport addon in order to visibly hide main navigation items in order to take them out of focus/tabbing 4. Slight amends to the dom service while I was there
32 lines
620 B
JavaScript
32 lines
620 B
JavaScript
import Component from '@glimmer/component';
|
|
import { inject as service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
|
|
export default class AppComponent extends Component {
|
|
@service('dom') dom;
|
|
|
|
constructor(args, owner) {
|
|
super(...arguments);
|
|
this.guid = this.dom.guid(this);
|
|
}
|
|
|
|
@action
|
|
keypressClick(e) {
|
|
e.target.dispatchEvent(new MouseEvent('click'));
|
|
}
|
|
|
|
@action
|
|
focus(e) {
|
|
const href = e.target.getAttribute('href');
|
|
if (href.startsWith('#')) {
|
|
e.preventDefault();
|
|
this.dom.focus(href);
|
|
}
|
|
}
|
|
|
|
@action
|
|
unfocus(e) {
|
|
e.target.blur();
|
|
}
|
|
}
|