templates/assets/js/navigation.js
function (state) {
            var features = document.querySelectorAll('.feature-with-scenarios'),
                scenarios,
                counter = 0;

            for (var i = 0; i < features.length; i++) {
                scenarios = features[i].querySelectorAll('.scenario');
                counter = 0;
                for (var j = 0; j < scenarios.length; j++) {
                    if (scenarios[j].classList.contains(state)) {
                        counter++;
                    }
                }
                if (counter === scenarios.length) {
                    features[i].classList.add('hidden');
                }
            }
        }
function (state) {
            var features = document.querySelectorAll('.feature-with-scenarios'),
                scenarios,
                counter = 0;

            for (var i = 0; i < features.length; i++) {
                scenarios = features[i].querySelectorAll('.scenario');
                counter = 0;
                for (var j = 0; j < scenarios.length; j++) {
                    if (scenarios[j].classList.contains(state)) {
                        counter++;
                    }
                }
                if (counter === scenarios.length) {
                    features[i].classList.add('hidden');
                }
            }
        }
function ( state ) { var features = document . querySelectorAll ( '.feature-with-scenarios' ) , scenarios , counter = 0 ; for ( var i = 0 ; i < features . length ; i ++ ) { scenarios = features [ i ] . querySelectorAll ( '.scenario' ) ; counter = 0 ; for ( var j = 0 ; j < scenarios . length ; j ++ ) { if ( scenarios [ j ] . classList . contains ( state ) ) { counter ++ ; } } if ( counter === scenarios . length ) { features [ i ] . classList . add ( 'hidden' ) ; } } }
Hide features and scenarios which are not corresponding to the triggered button state.
eg. passed button hides all failed scenarios and features if the feature
contains only failed scenarios. If there is at least one passed scenario within the feature, the feature description is displayed.
@param state indicates the button state which corresponds with scenario status
Hide features and scenarios which are not corresponding to the triggered button state . eg . passed button hides all failed scenarios and features if the feature contains only failed scenarios . If there is at least one passed scenario within the feature the feature description is displayed .