B2G/gecko/browser/components/tabview/ui.js
// Convenience function to get the next tab closest to the entered position
Convenience function to get the next tab closest to the entered position
Convenience function to get the next tab closest to the entered position
function UI_getClosestTab(tabCenter) {
    let cl = null;
    let clDist;
    TabItems.getItems().forEach(function (item) {
      if (!item.parent || item.parent.hidden)
        return;
      let testDist = tabCenter.distance(item.bounds.center());
      if (cl==null || testDist < clDist) {
        cl = item;
        clDist = testDist;
      }
    });
    return cl;
  }
function UI_getClosestTab ( tabCenter ) { let cl = null ; let clDist ; TabItems . getItems ( ) . forEach ( function ( item ) { if ( ! item . parent || item . parent . hidden ) return ; let testDist = tabCenter . distance ( item . bounds . center ( ) ) ; if ( cl == null || testDist < clDist ) { cl = item ; clDist = testDist ; } } ) ; return cl ; }
Convenience function to get the next tab closest to the entered position
Convenience function to get the next tab closest to the entered position