gitea源码

1234567891011121314
  1. import {linkLabelAndInput} from './base.ts';
  2. export function initAriaCheckboxPatch() {
  3. // link the label and the input element so it's clickable and accessible
  4. for (const el of document.querySelectorAll('.ui.checkbox')) {
  5. if (el.hasAttribute('data-checkbox-patched')) continue;
  6. const label = el.querySelector('label');
  7. const input = el.querySelector('input');
  8. if (!label || !input) continue;
  9. linkLabelAndInput(label, input);
  10. el.setAttribute('data-checkbox-patched', 'true');
  11. }
  12. }