src/js/INTER-Mediator.js
// Detect cross table components in a tbody enclosure.
Detect cross table components in a tbody enclosure.
Detect cross table components in a tbody enclosure .
function crossTableComponents(node) {
        let components = []
        let count = 0
        repeatCTComponents(node.childNodes)
        return components
        function repeatCTComponents(nodes) {
          for (let i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType === 1 && (nodes[i].tagName === 'TH' || nodes[i].tagName === 'TD')) {
              components[count] = nodes[i]
              count += 1
            } else {
              const childNodes = nodes[i].childNodes
              if (childNodes) {
                repeatCTComponents(childNodes)
              }
            }
          }
        }
      }
function crossTableComponents ( node ) { let components = [ ] let count = 0 repeatCTComponents ( node . childNodes ) return components function repeatCTComponents ( nodes ) { for ( let i = 0 ; i < nodes . length ; i ++ ) { if ( nodes [ i ] . nodeType === 1 && ( nodes [ i ] . tagName === 'TH' || nodes [ i ] . tagName === 'TD' ) ) { components [ count ] = nodes [ i ] count += 1 } else { const childNodes = nodes [ i ] . childNodes if ( childNodes ) { repeatCTComponents ( childNodes ) } } } } }
Detect cross table components in a tbody enclosure.
Detect cross table components in a tbody enclosure .