code.gitea.io/gitea@v1.22.3/web_src/js/modules/fomantic/checkbox.js (about)

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