//= require dropzone $(document).on('rails_admin.dom_ready', function() { // disable auto discover Dropzone.autoDiscover = true; if ($(".dropzone").length){ var dropzone = new Dropzone (".dropzone", { maxFilesize: 256, // Set the maximum file size to 256 MB paramName: "album[second_attr][]", // Rails expects the file upload to be something like model[field_name] addRemoveLinks: false, // Don't show remove links on dropzone itself. // Translations dictDefaultMessage: "<%= I18n.t('admin.actions.dropzone.dictDefaultMessage') %>", dictFallbackMessage: "<%= I18n.t('admin.actions.dropzone.dictFallbackMessage') %>", dictFallbackText: "<%= I18n.t('admin.actions.dropzone.dictFallbackText') %>", dictFileTooBig: "<%= I18n.t('admin.actions.dropzone.dictFileTooBig') %>", dictInvalidFileType: "<%= I18n.t('admin.actions.dropzone.dictInvalidFileType') %>", dictResponseError: "<%= I18n.t('admin.actions.dropzone.dictResponseError') %>", dictCancelUpload: "<%= I18n.t('admin.actions.dropzone.dictCancelUpload') %>", dictCancelUploadConfirmation: "<%= I18n.t('admin.actions.dropzone.dictCancelUploadConfirmation') %>", dictRemoveFile: "<%= I18n.t('admin.actions.dropzone.dictRemoveFile') %>", dictMaxFilesExceeded: "<%= I18n.t('admin.actions.dropzone.dictMaxFilesExceeded') %>" }); } });