mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
510 B
TypeScript
14 lines
510 B
TypeScript
import {linkLabelAndInput} from './base.ts';
|
|
|
|
export function initAriaCheckboxPatch() {
|
|
// link the label and the input element so it's clickable and accessible
|
|
for (const el of document.querySelectorAll('.ui.checkbox')) {
|
|
if (el.hasAttribute('data-checkbox-patched')) continue;
|
|
const label = el.querySelector('label');
|
|
const input = el.querySelector('input');
|
|
if (!label || !input) continue;
|
|
linkLabelAndInput(label, input);
|
|
el.setAttribute('data-checkbox-patched', 'true');
|
|
}
|
|
}
|