effective_assets 1.9.11 → 1.9.12

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
  SHA1:
3
- metadata.gz: 51e3745a945790addff0431348d52cef20252584
4
- data.tar.gz: 9f4dcb6b9e3a4d8545d4ed1861e18c046c23c8d5
3
+ metadata.gz: f7dd6fa68c96a18681c35d8ce7507db826248a71
4
+ data.tar.gz: 43a1a5b03f45d5a500c39f11901093bd6ef8c55c
5
5
  SHA512:
6
- metadata.gz: d7c2274c7cce4e3244576edb1f4156404679784fbcbd26ead0638dbcbe758b8cdd30fdfb5da0baa917d2ae17a924d1abed7d57d62207efb81748e61247b880d3
7
- data.tar.gz: f6da52fd6574eeecd3d6d419f84d9e6a81a29338cd77374c1fd275bc774e5e68aa2cb5cf4c687ecdaf8ace098cf25003b6c91ba049ec4010343103fe920561c9
6
+ metadata.gz: ac5de25b4aad824dd956a9cbfd139ac163f5a30a76bb4099d68b628aef11e82962470632848914b71053395f4dca65b247ea798ea531aad626505dc69ec1591d
7
+ data.tar.gz: 790c6004d467b78344d2f37a0134d92b37c76f5b77c584f730d91116c8364f9c545574140927a5a78f9497bcb992d1b958bf279df4e3096bed2279c0157053fe
@@ -1,5 +1,5 @@
1
- initialize = ->
2
- $('div.asset-box-uploader:not(.initialized)').each (i, element) ->
1
+ initialize = (target) ->
2
+ $(target || document).find('div.asset-box-uploader:not(.initialized)').each (i, element) ->
3
3
  element = $(element)
4
4
  options = element.data('input-js-options') || {}
5
5
 
@@ -13,3 +13,4 @@ $ -> initialize()
13
13
  $(document).on 'page:change', -> initialize()
14
14
  $(document).on 'turbolinks:load', -> initialize()
15
15
  $(document).on 'cocoon:after-insert', -> initialize()
16
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
@@ -93,11 +93,17 @@ module Inputs
93
93
  @options[:disabled] = true
94
94
  end
95
95
 
96
+ html_class = [
97
+ ('drop-files' if @options[:uploader_drop_files]),
98
+ ((@options[:uploader_html] || {})[:class])
99
+ ].compact.join(' ')
100
+
96
101
  render(
97
102
  :partial => 'asset_box_input/uploader',
98
103
  :locals => {
99
104
  :uid => @options[:uid],
100
105
  :click_submit => @options[:click_submit],
106
+ :html_class => html_class,
101
107
  :limit => @options[:limit],
102
108
  :disabled => @options[:disabled],
103
109
  :required => (@options[:required] == true && attachments.length == 0),
@@ -1,5 +1,5 @@
1
1
  .uploads
2
- .asset-box-uploader{id: "s3_#{uid}", class: ('drop-files' if drop_files), 'data-input-js-options': s3_uploader_input_js_options(limit: limit, file_types: file_types, click_submit: click_submit) }
2
+ .asset-box-uploader{id: "s3_#{uid}", class: html_class, 'data-input-js-options': s3_uploader_input_js_options(limit: limit, file_types: file_types, click_submit: click_submit) }
3
3
  = s3_uploader_fields(aws_acl: aws_acl)
4
4
 
5
5
  - if drop_files
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.9.11'.freeze
2
+ VERSION = '1.9.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.11
4
+ version: 1.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2018-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails