<commit_before>ckan.module('orgportals_goto_next_section', function ($, _) {
  'use strict';

  return {
    initialize: function() {
      var nextSectionBtn = this.el;

      nextSectionBtn.on('click', function onNextSectionBtnClick() {
        var section = nextSectionBtn.closest('div[data-section]');
        var nextSection, topOffset;

        if (section.length === 1) {
          nextSection = section.next();
          topOffset = nextSection.offset().top;

          window.scrollTo(0, topOffset - 60);
        }
      });
    }
  }
});
<commit_msg>Hide next section buttons if there is only one section<commit_after>ckan.module('orgportals_goto_next_section', function ($, _) {
  'use strict';

  return {
    initialize: function() {
      //We don't need to go to the next section if there is only one section
      if ($("[data-section]").length === 1) {
        $(".next-section-container").hide()
      }

      var nextSectionBtn = this.el;

      nextSectionBtn.on('click', function onNextSectionBtnClick() {
        var section = nextSectionBtn.closest('div[data-section]');
        var nextSection, topOffset;

        if (section.length === 1) {
          nextSection = section.next();
          topOffset = nextSection.offset().top;

          window.scrollTo(0, topOffset - 60);
        }
      });
    }
  }
});

{'fraction_non_alphanumeric': 0.137621540762902, 'fraction_numerical': 0.006731488406881077, 'mean_word_length': 2.530343007915567, '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': '128422', 'n_tokens_mistral': 404, 'n_tokens_neox': 387, 'n_words': 86}