media.upload_multiple.js 893 B

123456789101112131415161718192021
  1. Drupal.behaviors.mediaUploadMultiple = {};
  2. Drupal.behaviors.mediaUploadMultiple.attach = function (context, settings) {
  3. // When the plupload element initializes, it expands the size of the elements
  4. // it has created, so we need to resize the browser iframe after it's done.
  5. var uploader = jQuery('#edit-upload').pluploadQueue();
  6. if (uploader) {
  7. // Handle the case in which the uploader has already finished initializing.
  8. Drupal.media.browser.resizeIframe();
  9. // Handle the case in which the uploader has not yet initialized.
  10. uploader.bind("PostInit", Drupal.media.browser.resizeIframe);
  11. uploader.bind('StateChanged', Drupal.behaviors.mediaUploadMultiple.submit);
  12. }
  13. };
  14. Drupal.behaviors.mediaUploadMultiple.submit = function (uploader, file) {
  15. if (uploader.state == 2) {
  16. jQuery('#media-add-upload-multiple .form-submit').val(Drupal.t('Loading...'));
  17. }
  18. };