paragraphs.js 593 B

12345678910111213141516171819202122232425
  1. /**
  2. * @file
  3. * Provides JavaScript for Paragraphs.
  4. */
  5. (function ($) {
  6. /**
  7. * Allows submit buttons in entity forms to trigger uploads by undoing
  8. * work done by Drupal.behaviors.fileButtons.
  9. */
  10. Drupal.behaviors.paragraphs = {
  11. attach: function (context) {
  12. if (Drupal.file) {
  13. $('input.paragraphs-add-more-submit', context).unbind('mousedown', Drupal.file.disableFields);
  14. }
  15. },
  16. detach: function (context) {
  17. if (Drupal.file) {
  18. $('input.form-submit', context).bind('mousedown', Drupal.file.disableFields);
  19. }
  20. }
  21. };
  22. })(jQuery);