<commit_before>require('jquery');

module.exports = function() {
  $('form').on('submit', function() {
    if (typeof $.data(this, 'disabledOnSubmit') === 'undefined') {
      $.data(this, 'disabledOnSubmit', {
        submited: true
      });

      $('input[type=submit], button[type=submit]', this).each(function() {
        $(this).prop('disabled', true);
      });

      return true;
    } else {
      return false;
    }
  });
};<commit_msg>[SA-855] Added check to prevent disabling buttons if ignore-double-submit data attribute exists on the button<commit_after>require('jquery');

module.exports = function() {
  $('form').on('submit', function() {
    if (typeof $.data(this, 'disabledOnSubmit') === 'undefined') {
      $.data(this, 'disabledOnSubmit', {
        submited: true
      });

      $('input[type=submit], button[type=submit]', this).each(function() {
        var $button = $(this);

        // only disable buttons if they don't contain 'ignore-double-submit' data attribute
        if (!$button.data('ignore-double-submit')) {
          $button.prop('disabled', true);
        }
        
      });

      return true;
    } else {
      return false;
    }
  });
};
{'fraction_non_alphanumeric': 0.1820469798657718, 'fraction_numerical': 0.0025167785234899327, 'mean_word_length': 2.7753164556962027, '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': '6534002', 'n_tokens_mistral': 356, 'n_tokens_neox': 347, 'n_words': 77}