(function($) {
  'use strict';

  var button = $('[data-disable-with]');

  button.parents('form').on('submit', function() {
    button.prop('disabled', true);
    button.val(button.data('disable-with'));
  });
})(jQuery);

(function($) {
  'use strict';

  var $disableButtons = $('[data-disable-with]');

  $disableButtons.parents('form').on('submit', function() {
    var $currentFormButton = $(this).find($disableButtons);

    $currentFormButton.prop('disabled', true);
    $currentFormButton.val($currentFormButton.data('disable-with'));
  });
})(jQuery);

Fix bug with disabling buttons when there is two forms
Fix bug with disabling buttons when there is two forms

- old code was updating the button of both form buttons
  rather than just the button clicked
