<commit_before>var locastyle = locastyle || {};

locastyle.steps = (function() {
  'use strict';

  var config = {
    selectors: {
      moduleActive: '.ls-actived [data-ls-module="steps"]',
      nav: '.ls-steps-nav',
      button: '.ls-steps-btn',
      container: '.ls-steps-content',
      parent: '.ls-steps'
    },
    status: {
      active: 'ls-active',
      actived: 'ls-actived'
    },
    classes: {
      active: '.ls-active'
    },
    actions:{
      next: '.ls-steps-content [data-action="next"]',
      prev: '.ls-steps-content [data-action="prev"]'
    }
  };

  function init() {
    unbind();
    createArrow();
    ariaSteps();
    addAriaLabel();
    addActivedNav();
    stepsAffix();
    bindClickOnTriggers();
    nextStep();
    prevStep();
  }


  // Always visible navigation when the page scrolls
  function stepsAffix() {
    var $steps   = $(config.selectors.nav);
    var offset    = $steps.offset();
    var marginTop = 20;
    var $heightStep = $(config.selectors.parent).height();
    var $heightNav  = $(config.selectors.nav).height();
    var $areaStep = parseInt($heightStep + ($heightNav * 2));

    $(window).scroll(function() {
     if ($(window).scrollTop() > offset.top ){
        var $scroll = parseInt($(window).scrollTop() - $heightNav)
        $steps.stop().animate({
         marginTop: $(window).scrollTop() - offset.top + $heightNav / 2
        });

        if($scroll >= $areaStep ) {
          $steps.stop().animate({
           marginTop: 0
         });
        }
     } else {
       $steps.stop().animate({
         marginTop: 0
       });
     };
    });
  }

  // Displays the contents related to the active button
  function addActivedNav() {
    var index = $(config.selectors.nav).find(config.classes.active).index();

    // Checks if there are any enabled button to load the page
    if(index ===  -1){
      $(config.selectors.nav).each(function(){
        var $el = $(this).find('li:first').find(config.selectors.button);
        var $target = $el.data('target');
        activateStep($el, $($target));
      });

    } else{
      addActiveContent(index);
      index = parseInt(index + 1);<commit_msg>fix function stepsAffix<commit_after>var locastyle = locastyle || {};

locastyle.steps = (function() {
  'use strict';

  var config = {
    selectors: {
      moduleActive: '.ls-actived [data-ls-module="steps"]',
      nav: '.ls-steps-nav',
      button: '.ls-steps-btn',
      container: '.ls-steps-content',
      parent: '.ls-steps'
    },
    status: {
      active: 'ls-active',
      actived: 'ls-actived'
    },
    classes: {
      active: '.ls-active'
    },
    actions:{
      next: '.ls-steps-content [data-action="next"]',
      prev: '.ls-steps-content [data-action="prev"]'
    }
  };

  function init() {
    unbind();
    createArrow();
    ariaSteps();
    addAriaLabel();
    addActivedNav();
    stepsAffix();
    bindClickOnTriggers();
    nextStep();
    prevStep();
  }


  // Always visible navigation when the page scrolls
  function stepsAffix() {
    var $steps   = $(config.selectors.nav);
    var offset    = $steps.offset();
    var marginTop = 20;
    var $heightStep = $(config.selectors.parent).height();
    var $heightNav  = $(config.selectors.nav).height();
    var $areaStep = parseInt($heightStep + ($heightNav * 2));

    $(window).scroll(function() {
     if ($(window).scrollTop() > offset.top ){
        var $scroll = parseInt($(window).scrollTop() - $heightNav)
        $steps.stop().animate({
         marginTop: $(window).scrollTop() - offset.top + marginTop
        });

        if($scroll >= $areaStep ) {
          $steps.stop().animate({
           marginTop: 0
         });
        }
     } else {
       $steps.stop().animate({
         marginTop: 0
       });
     };
    });
  }

  // Displays the contents related to the active button
  function addActivedNav() {
    var index = $(config.selectors.nav).find(config.classes.active).index();

    // Checks if there are any enabled button to load the page
    if(index ===  -1){
      $(config.selectors.nav).each(function(){
        var $el = $(this).find('li:first').find(config.selectors.button);
        var $target = $el.data('target');
        activateStep($el, $($target));
      });

    } else{
      addActiveContent(index);
      index = parseInt(index + 1);
{'fraction_non_alphanumeric': 0.17369269753513014, 'fraction_numerical': 0.0034554250172771253, 'mean_word_length': 2.35548686244204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3945455', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1351, 'n_words': 278}