rails-uploader 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b1554bed2e981630207e781e2cb75015f00fedc24d3e539cde1f00ae4b6d1c9
4
- data.tar.gz: 6b01480fbfdd9cba2721a1a082a61c2ea4c15f3faea2c2f4b30d6ee8161dfd6c
3
+ metadata.gz: 0ee8765eed0acd43fa3f0298b920818c61ce98dd87489357589617c253e08b78
4
+ data.tar.gz: 700490dfe078e643704fd6c08a6bb4d619ce62eaa776493f4ad11c26ee294851
5
5
  SHA512:
6
- metadata.gz: 3002afb2276e1261e757eb099145470af8e0363151bb4381c0154ec4c7940f49d19fc6b712bed1799a248743cb49468d960e229720b458bffc2845e93d4a44d9
7
- data.tar.gz: d6f0918940ec2c5b66634398542a1c63854628416c3f506d04282b83869c1046a9221becf34e6677b47d4e486de917afbcb3e230f29bb7abaab17b2333ca7935
6
+ metadata.gz: 02c90581ef78112caa2392c0257c200714ef64b2266f4b851ec651a0dd45d4e6c73000bc7111b160f125f27c796dd8120a6205f29b45afe5f6c0de3797c11bb0
7
+ data.tar.gz: ec0e0cc1ab8417f7930b9decd0610fde73163568a49c75e8dc3565c3ccb6dad770d5968c1780d35ff5b83cab3db4f27e434c1789c2978efdd7114bf1c705a80a
@@ -1,6 +1,7 @@
1
1
  <%= content_tag(:div, id: field.id, class: 'uploader-dnd-area', data: { tpml: field.klass.to_s, exists: field.exists? }) do -%>
2
2
  <%= hidden_field(field.object_name, :fileupload_guid, object: field.object) if field.object.new_record? %>
3
3
 
4
+ <p class='uploader-errors'></p>
4
5
  <div class="uploader-files"></div>
5
6
 
6
7
  <div class="uploader-dnd-hints">
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uploader
4
- VERSION = '0.5.1'
4
+ VERSION = '0.5.2'
5
5
  end
@@ -173,6 +173,7 @@
173
173
  deferred;
174
174
  var options = that.options;
175
175
  if (options.singular) { options.filesContainer.html(data.context || '') };
176
+ options.dropZone.find('.uploader-errors').text('');
176
177
  if (data.context) {
177
178
  data.context.each(function (index) {
178
179
  var file = files[index] ||
@@ -220,6 +221,9 @@
220
221
  $(this).data('fileupload'),
221
222
  template,
222
223
  deferred;
224
+ try { var errors = data._response.jqXHR.responseJSON.files[0].error || ''}
225
+ catch (e) { var errors = '' }
226
+ that.options.dropZone.find('.uploader-errors').text(errors);
223
227
  if (data.context) {
224
228
  data.context.each(function (index) {
225
229
  if (data.errorThrown !== 'abort') {
@@ -239,6 +243,7 @@
239
243
  that._trigger('failed', e, data);
240
244
  that._trigger('finished', e, data);
241
245
  deferred.resolve();
246
+ data.context.remove();
242
247
  }
243
248
  );
244
249
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Galeta
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-24 00:00:00.000000000 Z
12
+ date: 2020-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave