21 lines
387 B
JavaScript
21 lines
387 B
JavaScript
export const b = {
|
|
init: 'enhance',
|
|
}
|
|
|
|
export function enhance(_, __, el) {
|
|
if (el === undefined) { // nothing to enhance but init still runs
|
|
return;
|
|
}
|
|
|
|
if (el.classList.contains('js-only')) {
|
|
el.classList.remove('js-only');
|
|
}
|
|
|
|
if (el.disabled) {
|
|
el.disabled = false;
|
|
if (el.title.search('JavaScript') !== -1) {
|
|
el.removeAttribute('title');
|
|
}
|
|
}
|
|
}
|