src/components/tabs/js/tabsController.js
function incrementIndex (inc, focus) {
    var newIndex,
        key   = focus ? 'focusIndex' : 'selectedIndex',
        index = ctrl[ key ];
    for (newIndex = index + inc;
         ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;
         newIndex += inc) { /* do nothing */ }

    newIndex = (index + inc + ctrl.tabs.length) % ctrl.tabs.length;

    if (ctrl.tabs[ newIndex ]) {
      ctrl[ key ] = newIndex;
    }
  }
function incrementIndex (inc, focus) {
    var newIndex,
        key   = focus ? 'focusIndex' : 'selectedIndex',
        index = ctrl[ key ];
    for (newIndex = index + inc;
         ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;
         newIndex += inc) { /* do nothing */ }

    newIndex = (index + inc + ctrl.tabs.length) % ctrl.tabs.length;

    if (ctrl.tabs[ newIndex ]) {
      ctrl[ key ] = newIndex;
    }
  }
function incrementIndex ( inc , focus ) { var newIndex , key = focus ? 'focusIndex' : 'selectedIndex' , index = ctrl [ key ] ; for ( newIndex = index + inc ; ctrl . tabs [ newIndex ] && ctrl . tabs [ newIndex ] . scope . disabled ; newIndex += inc ) { /* do nothing */ } newIndex = ( index + inc + ctrl . tabs . length ) % ctrl . tabs . length ; if ( ctrl . tabs [ newIndex ] ) { ctrl [ key ] = newIndex ; } }
This moves the selected or focus index left or right. This is used by the keydown handler.
@param {number} inc amount to increment
@param {boolean} focus true to increment the focus index, false to increment the selected index
This moves the selected or focus index left or right . This is used by the keydown handler .