src/render/browser/extend/components/tabheader/index.js
function initClickEvent (tabheader) {
  const box = tabheader.box

  box.addEventListener('click', function (evt) {
    let target = evt.target
    if (target.nodeName === 'UL') {
      return
    }

    if (target.parentNode.nodeName === 'LI') {
      target = target.parentNode
    }

    const floor = target.getAttribute('data-floor')
    /* eslint-disable eqeqeq */
    if (tabheader.data.attr.selectedIndex == floor) {
      // Duplicated clicking, not to trigger select event.
      return
    }
    /* eslint-enable eqeqeq */

    fireEvent(target, 'select', { index: floor })
  })
}
function initClickEvent (tabheader) {
  const box = tabheader.box

  box.addEventListener('click', function (evt) {
    let target = evt.target
    if (target.nodeName === 'UL') {
      return
    }

    if (target.parentNode.nodeName === 'LI') {
      target = target.parentNode
    }

    const floor = target.getAttribute('data-floor')
    /* eslint-disable eqeqeq */
    if (tabheader.data.attr.selectedIndex == floor) {
      // Duplicated clicking, not to trigger select event.
      return
    }
    /* eslint-enable eqeqeq */

    fireEvent(target, 'select', { index: floor })
  })
}
function initClickEvent ( tabheader ) { const box = tabheader . box box . addEventListener ( 'click' , function ( evt ) { let target = evt . target if ( target . nodeName === 'UL' ) { return } if ( target . parentNode . nodeName === 'LI' ) { target = target . parentNode } const floor = target . getAttribute ( 'data-floor' ) /* eslint-disable eqeqeq */ if ( tabheader . data . attr . selectedIndex == floor ) { // Duplicated clicking, not to trigger select event. return } /* eslint-enable eqeqeq */ fireEvent ( target , 'select' , { index : floor } ) } ) }
init events.
init events .