mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 08:38:49 +01:00
Add some ESLint rules and fix some related issues
This commit is contained in:
parent
43de3b8a01
commit
944a1065d3
5 changed files with 46 additions and 42 deletions
|
|
@ -7,7 +7,7 @@
|
|||
// Without an href, links are non-keyboard-focusable and are not presented on
|
||||
// blind screen readers. We default to the empty anchor `#` href.
|
||||
function enforceHref(attributes) {
|
||||
if (! _.has(attributes, 'href')) {
|
||||
if (!_.has(attributes, 'href')) {
|
||||
attributes.href = '#';
|
||||
}
|
||||
return attributes;
|
||||
|
|
@ -17,7 +17,7 @@ function enforceHref(attributes) {
|
|||
// presented by screen readers. `aria-label`, on the other hand, is specific to
|
||||
// accessibility and is presented in ways that title shouldn't be.
|
||||
function copyTitleInAriaLabel(attributes) {
|
||||
if (! _.has(attributes, 'aria-label') && _.has(attributes, 'title')) {
|
||||
if (!_.has(attributes, 'aria-label') && _.has(attributes, 'title')) {
|
||||
attributes['aria-label'] = attributes.title;
|
||||
}
|
||||
return attributes;
|
||||
|
|
@ -34,8 +34,8 @@ const {
|
|||
|
||||
HTML.A = (attributes, ...others) => {
|
||||
return superA(copyTitleInAriaLabel(enforceHref(attributes)), ...others);
|
||||
}
|
||||
};
|
||||
|
||||
HTML.I = (attributes, ...others) => {
|
||||
return superI(copyTitleInAriaLabel(attributes), ...others);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue