release/modular/ct-ui-router-extras.sticky.js
function mapInactives() {
        var mappedStates = {};
        angular.forEach(inactiveStates, function (state, name) {
          var stickyAncestors = getStickyStateStack(state);
          for (var i = 0; i < stickyAncestors.length; i++) {
            var parent = stickyAncestors[i].parent;
            mappedStates[parent.name] = mappedStates[parent.name] || [];
            mappedStates[parent.name].push(state);
          }
          if (mappedStates['']) {
            // This is necessary to compute Transition.inactives when there are sticky states are children to root state.
            mappedStates['__inactives'] = mappedStates[''];  // jshint ignore:line
          }
        });
        return mappedStates;
      }
function mapInactives() {
        var mappedStates = {};
        angular.forEach(inactiveStates, function (state, name) {
          var stickyAncestors = getStickyStateStack(state);
          for (var i = 0; i < stickyAncestors.length; i++) {
            var parent = stickyAncestors[i].parent;
            mappedStates[parent.name] = mappedStates[parent.name] || [];
            mappedStates[parent.name].push(state);
          }
          if (mappedStates['']) {
            // This is necessary to compute Transition.inactives when there are sticky states are children to root state.
            mappedStates['__inactives'] = mappedStates[''];  // jshint ignore:line
          }
        });
        return mappedStates;
      }
function mapInactives ( ) { var mappedStates = { } ; angular . forEach ( inactiveStates , function ( state , name ) { var stickyAncestors = getStickyStateStack ( state ) ; for ( var i = 0 ; i < stickyAncestors . length ; i ++ ) { var parent = stickyAncestors [ i ] . parent ; mappedStates [ parent . name ] = mappedStates [ parent . name ] || [ ] ; mappedStates [ parent . name ] . push ( state ) ; } if ( mappedStates [ '' ] ) { // This is necessary to compute Transition.inactives when there are sticky states are children to root state. mappedStates [ '__inactives' ] = mappedStates [ '' ] ; // jshint ignore:line } } ) ; return mappedStates ; }
Each inactive states is either a sticky state, or a child of a sticky state. This function finds the closest ancestor sticky state, then find that state's parent. Map all inactive states to their closest parent-to-sticky state.
Each inactive states is either a sticky state or a child of a sticky state . This function finds the closest ancestor sticky state then find that state s parent . Map all inactive states to their closest parent - to - sticky state .