<commit_before>var App = window.election;

App.currentStep = 0;
$('a.btn-step').click(function() {
    var $btn = $(this);
    var isStepBack = false;

    if (!$btn.hasClass("dontcountstep")) {
        isStepBack = $btn.is('#krokomer a');
        (isStepBack)
            ? App.currentStep--
            : App.currentStep++;

        updateStep(App.currentStep);
    }

    $('.row').hide();
    $.when($($btn.attr('href')).show()).done(function() {
        resizeCanvas();
        App.Analytics.trackStep($btn.prop('hash'), App.currentStep, isStepBack);
    })
});

function updateStep(step) {
    var $progressContainer = $('.nav--progress');

    if (0 === step) {
        $progressContainer.hide();
        return;
    }

    $progressContainer
        .find('li:nth-child('+step+')')
        .siblings('li')
            .hide()
        .end()<commit_msg>Scroll to the top after step changed<commit_after>var App = window.election;

App.currentStep = 0;
$('a.btn-step').click(function() {
    var $btn = $(this);
    var isStepBack = false;

    if (!$btn.hasClass("dontcountstep")) {
        isStepBack = $btn.is('#krokomer a');
        (isStepBack)
            ? App.currentStep--
            : App.currentStep++;

        updateStep(App.currentStep);
    }

    $('.row').hide();
    $.when($($btn.attr('href')).show()).done(function() {
        resizeCanvas();
        App.Analytics.trackStep($btn.prop('hash'), App.currentStep, isStepBack);
        $('html, body').animate({ scrollTop: 0 }, 'slow');
    })
});

function updateStep(step) {
    var $progressContainer = $('.nav--progress');

    if (0 === step) {
        $progressContainer.hide();
        return;
    }

    $progressContainer
        .find('li:nth-child('+step+')')
        .siblings('li')
            .hide()
        .end()
{'fraction_non_alphanumeric': 0.19644839067702552, 'fraction_numerical': 0.002774694783573807, 'mean_word_length': 2.3638059701492535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6143260', 'n_tokens_mistral': 588, 'n_tokens_neox': 572, 'n_words': 94}