effective_form_inputs 1.1.12 → 1.1.13

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: 82987aa71a7ea0640039fdac3962555a982810d6
4
- data.tar.gz: d3784ba5af000a1e585e013ff83720d0d6e672e0
3
+ metadata.gz: aeb0181400a5d7e2f7cfdc65c37123497b73ea10
4
+ data.tar.gz: 8a1e97eb165696ed7b7e59b470bc775eba9d6837
5
5
  SHA512:
6
- metadata.gz: f9f416cf372c13830b9f1d4d1ca8b417de19bcc801432f2a66f9e80469c6ff4b061817344ff0a0a2fc6ef8a9ff183394a385cd7c54d142ac661b01f380f0c4f2
7
- data.tar.gz: d1dd15c4e4d29e5f4a3b3b9bb82a52b7da4d3ef62c1de666938a6d7de6de3bf7dd8bcaf4cbd3facff74282060a51957d56050c311c11a1c7fcad791519736979
6
+ metadata.gz: c8d40052e83487c71edbd6f305660a3b965a2becc9bffe6243aba6f40441bc773c6fcdd4a4158aa15c92e427b20415fc49997ad32d656d38aa91bd453c99f8ed
7
+ data.tar.gz: a6c35017121e2308f56e004d0a6e20c9524de1ff564977ded55989939c635417631f4d021989cfb630b17268e38d4a3d9ef59313ed2af2210abdd209664f33e7
@@ -1,5 +1,5 @@
1
- initialize = ->
2
- $inputs = $('textarea.effective_ckeditor_text_area:not(.initialized)')
1
+ initialize = (target) ->
2
+ $inputs = $(target || document).find('textarea.effective_ckeditor_text_area:not(.initialized)')
3
3
  setupCkeditor($inputs)
4
4
 
5
5
  $inputs.each (i, element) ->
@@ -93,5 +93,7 @@ $(document).on 'page:change', -> initialize()
93
93
  $(document).on 'turbolinks:load', -> initialize()
94
94
  $(document).on 'turbolinks:render', -> initialize()
95
95
  $(document).on 'cocoon:after-insert', -> initialize()
96
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
97
+
96
98
  $(document).on 'turbolinks:before-cache', ->
97
99
  CKEDITOR.instances[name].destroy() for name, _ of CKEDITOR.instances if CKEDITOR?
@@ -1,7 +1,7 @@
1
1
  # http://eonasdan.github.io/bootstrap-datetimepicker/Options/
2
2
 
3
- initialize = ->
4
- $('input.effective_date_picker:not(.initialized)').each (i, element) ->
3
+ initialize = (target) ->
4
+ $(target || document).find('input.effective_date_picker:not(.initialized)').each (i, element) ->
5
5
  element = $(element)
6
6
  options = element.data('input-js-options') || {}
7
7
 
@@ -13,6 +13,9 @@ $(document).on 'page:change', -> initialize()
13
13
  $(document).on 'turbolinks:load', -> initialize()
14
14
  $(document).on 'turbolinks:render', -> initialize()
15
15
  $(document).on 'cocoon:after-insert', -> initialize()
16
- $(document).on 'turbolinks:before-cache', ->
17
- $('input.effective_date_picker.initialized').datetimepicker('destroy')
16
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
18
17
 
18
+ $(document).on 'turbolinks:before-cache', ->
19
+ $('input.effective_date_picker.initialized').each (i, element) ->
20
+ $input = $(element)
21
+ $input.datetimepicker('destroy') if $input.data('datetimepicker')
@@ -1,7 +1,7 @@
1
1
  # http://eonasdan.github.io/bootstrap-datetimepicker/Options/
2
2
 
3
- initialize = ->
4
- $('input.effective_date_time_picker:not(.initialized)').each (i, element) ->
3
+ initialize = (target) ->
4
+ $(target || document).find('input.effective_date_time_picker:not(.initialized)').each (i, element) ->
5
5
  element = $(element)
6
6
  options = element.data('input-js-options') || {}
7
7
 
@@ -13,5 +13,9 @@ $(document).on 'page:change', -> initialize()
13
13
  $(document).on 'turbolinks:load', -> initialize()
14
14
  $(document).on 'turbolinks:render', -> initialize()
15
15
  $(document).on 'cocoon:after-insert', -> initialize()
16
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
17
+
16
18
  $(document).on 'turbolinks:before-cache', ->
17
- $('input.effective_date_time_picker.initialized').datetimepicker('destroy')
19
+ $('input.effective_date_time_picker.initialized').each (i, element) ->
20
+ $input = $(element)
21
+ $input.datetimepicker('destroy') if $input.data('datetimepicker')
@@ -1,5 +1,5 @@
1
- initialize = ->
2
- $('input.effective_email:not(.initialized)').each (i, element) ->
1
+ initialize = (target) ->
2
+ $(target || document).find('input.effective_email:not(.initialized)').each (i, element) ->
3
3
  element = $(element)
4
4
  options = element.data('input-js-options') || {}
5
5
 
@@ -11,3 +11,4 @@ $(document).on 'page:change', -> initialize()
11
11
  $(document).on 'turbolinks:load', -> initialize()
12
12
  $(document).on 'turbolinks:render', -> initialize()
13
13
  $(document).on 'cocoon:after-insert', -> initialize()
14
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
@@ -1,5 +1,5 @@
1
- initialize = ->
2
- $('div.effective-panel-select:not(.initialized)').each (i, element) ->
1
+ initialize = (target) ->
2
+ $(target || document).find('div.effective-panel-select:not(.initialized)').each (i, element) ->
3
3
  element = $(element)
4
4
  options = element.data('input-js-options') || {}
5
5
 
@@ -10,3 +10,4 @@ $(document).on 'page:change', -> initialize()
10
10
  $(document).on 'turbolinks:load', -> initialize()
11
11
  $(document).on 'turbolinks:render', -> initialize()
12
12
  $(document).on 'cocoon:after-insert', -> initialize()
13
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
@@ -1,5 +1,5 @@
1
- initialize = ->
2
- $('input.effective_price:not(.initialized)').each (i, element) ->
1
+ initialize = (target) ->
2
+ $(target || document).find('input.effective_price:not(.initialized)').each (i, element) ->
3
3
  element = $(element)
4
4
  options = element.data('input-js-options') || {}
5
5
 
@@ -11,6 +11,7 @@ $(document).on 'page:change', -> initialize()
11
11
  $(document).on 'turbolinks:load', -> initialize()
12
12
  $(document).on 'turbolinks:render', -> initialize()
13
13
  $(document).on 'cocoon:after-insert', -> initialize()
14
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
14
15
 
15
16
  # Prevent non-currency buttons from being pressed
16
17
  $(document).on 'keydown', "input[type='text'].effective_price", (event) ->
@@ -6,8 +6,8 @@ formatWithGlyphicon = (data, container) ->
6
6
  else
7
7
  data.text
8
8
 
9
- initialize = ->
10
- $('select.effective_select:not(.initialized)').each (i, element) ->
9
+ initialize = (target) ->
10
+ $(target || document).find('select.effective_select:not(.initialized)').each (i, element) ->
11
11
  element = $(element)
12
12
  options = element.data('input-js-options') || {}
13
13
 
@@ -28,8 +28,13 @@ $ -> initialize()
28
28
  $(document).on 'page:change', -> initialize()
29
29
  $(document).on 'turbolinks:load', -> initialize()
30
30
  $(document).on 'turbolinks:render', -> initialize()
31
- $(document).on 'turbolinks:before-cache', -> $('select.effective_select.initialized').select2('destroy')
32
31
  $(document).on 'cocoon:after-insert', -> initialize()
32
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
33
+
34
+ $(document).on 'turbolinks:before-render', ->
35
+ $('select.effective_select.initialized').each (i, element) ->
36
+ $input = $(element)
37
+ $input.select2('destroy') if $input.data('select2')
33
38
 
34
39
  # If we're working with a polymorphic select, split out the ID and assign the hidden _type and _id fields
35
40
  $(document).on 'change', "select.effective_select.polymorphic", (event) ->
@@ -1,7 +1,7 @@
1
1
  # http://digitalbush.com/projects/masked-input-plugin/
2
2
 
3
- initialize = ->
4
- $('input.effective_tel:not(.initialized)').each (i, element) ->
3
+ initialize = (target) ->
4
+ $(target || document).find('input.effective_tel:not(.initialized)').each (i, element) ->
5
5
  element = $(element)
6
6
  options = element.data('input-js-options') || {}
7
7
 
@@ -15,3 +15,4 @@ $(document).on 'page:change', -> initialize()
15
15
  $(document).on 'turbolinks:load', -> initialize()
16
16
  $(document).on 'turbolinks:render', -> initialize()
17
17
  $(document).on 'cocoon:after-insert', -> initialize()
18
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
@@ -1,7 +1,7 @@
1
1
  # http://eonasdan.github.io/bootstrap-datetimepicker/Options/
2
2
 
3
- initialize = ->
4
- $('input.effective_time_picker:not(.initialized)').each (i, element) ->
3
+ initialize = (target) ->
4
+ $(target || document).find('input.effective_time_picker:not(.initialized)').each (i, element) ->
5
5
  element = $(element)
6
6
  options = element.data('input-js-options') || {}
7
7
 
@@ -13,6 +13,10 @@ $(document).on 'page:change', -> initialize()
13
13
  $(document).on 'turbolinks:load', -> initialize()
14
14
  $(document).on 'turbolinks:render', -> initialize()
15
15
  $(document).on 'cocoon:after-insert', -> initialize()
16
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
17
+
16
18
  $(document).on 'turbolinks:before-cache', ->
17
- $('input.effective_time_picker.initialized').datetimepicker('destroy')
19
+ $('input.effective_time_picker.initialized').each (i, element) ->
20
+ $input = $(element)
21
+ $input.datetimepicker('destroy') if $input.data('datetimepicker')
18
22
 
@@ -1,7 +1,7 @@
1
1
  # http://digitalbush.com/projects/masked-input-plugin/
2
2
 
3
- initialize = ->
4
- $('input.effective_url:not(.initialized)').each (i, element) ->
3
+ initialize = (target) ->
4
+ $(target || document).find('input.effective_url:not(.initialized)').each (i, element) ->
5
5
  element = $(element)
6
6
  options = element.data('input-js-options') || {}
7
7
 
@@ -13,3 +13,4 @@ $(document).on 'page:change', -> initialize()
13
13
  $(document).on 'turbolinks:load', -> initialize()
14
14
  $(document).on 'turbolinks:render', -> initialize()
15
15
  $(document).on 'cocoon:after-insert', -> initialize()
16
+ $(document).on 'effective-form-inputs:initialize', (event) -> initialize(event.currentTarget)
@@ -1,3 +1,3 @@
1
1
  module EffectiveFormInputs
2
- VERSION = '1.1.12'.freeze
2
+ VERSION = '1.1.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_form_inputs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.1.13
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-10-26 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