src/components/tabs/js/tabsController.js
function updateTabOrder () {
    var selectedItem   = ctrl.tabs[ ctrl.selectedIndex ],
        focusItem      = ctrl.tabs[ ctrl.focusIndex ];
    ctrl.tabs          = ctrl.tabs.sort(function (a, b) {
      return a.index - b.index;
    });
    ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);
    ctrl.focusIndex    = ctrl.tabs.indexOf(focusItem);
  }
function updateTabOrder () {
    var selectedItem   = ctrl.tabs[ ctrl.selectedIndex ],
        focusItem      = ctrl.tabs[ ctrl.focusIndex ];
    ctrl.tabs          = ctrl.tabs.sort(function (a, b) {
      return a.index - b.index;
    });
    ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);
    ctrl.focusIndex    = ctrl.tabs.indexOf(focusItem);
  }
function updateTabOrder ( ) { var selectedItem = ctrl . tabs [ ctrl . selectedIndex ] , focusItem = ctrl . tabs [ ctrl . focusIndex ] ; ctrl . tabs = ctrl . tabs . sort ( function ( a , b ) { return a . index - b . index ; } ) ; ctrl . selectedIndex = ctrl . tabs . indexOf ( selectedItem ) ; ctrl . focusIndex = ctrl . tabs . indexOf ( focusItem ) ; }
Re-orders the tabs and updates the selected and focus indexes to their new positions.
This is triggered by `tabDirective.js` when the user's tabs have been re-ordered.
Re - orders the tabs and updates the selected and focus indexes to their new positions . This is triggered by tabDirective . js when the user s tabs have been re - ordered .