effective_bootstrap 0.6.6 → 0.6.7

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: b4522b40a141a3ea3b72005b21e9f2dfc69c4ac0098fb9fcae41582f0f273278
4
- data.tar.gz: eaa49061b18dadb536b6bc1a738a4605b7271320e27e78d109901cd98dfdfe3b
3
+ metadata.gz: 8e583f4edb3e2862a328ab4040676d9efba022848730e512948b3b1f2874806b
4
+ data.tar.gz: ef93586b5e06a272253677e9d6c320d7e33971ab35c797dc070fd86a6e25288a
5
5
  SHA512:
6
- metadata.gz: 9a502e5e55ec541dd7376735fe9dc32f0bee314e3f9e7a7b0f60f66aa1287eb4fc5ea874ff750dc8f6738a44ef204394bb123bdcd39fca450edc0f220cb61384
7
- data.tar.gz: 4ca777f00efe441d239f4c1cef3679a6b9052593ca5622d032ffe764d9130679f5f7725f400aeef8356e96ded6781e3c600ac892c6e5ac81c47bf4b94cc09a63
6
+ metadata.gz: 4a20412b96e1a3b082daab2da51c1a81cb1e5b61cc61ab6305ca11faf2d7a0a8d8e51501508f8406bba67aa046a11fcd544bde2ab96d76f6284f89dcf4dedcc8
7
+ data.tar.gz: de05e6e3d0e4ffc303d57da9b159b2f3ac282d8aa38d4152dc687fc7e91991ee38b42b9211ff2e1aa0c8338371a842d98d94f76b4591c11cdfccb456bd421896
@@ -164,3 +164,6 @@ $(document).on 'ajax:beforeSend', 'form[data-remote]', (event) ->
164
164
  $(document).on 'ajax:beforeSend', '[data-method=delete]', (event) ->
165
165
  if ($delete = $(@)).data('closest')
166
166
  EffectiveForm.setCurrentDelete($delete.closest($delete.data('closest')))
167
+
168
+ $(document).on 'reset', 'form', (event) ->
169
+ EffectiveForm.reset($(event.currentTarget))
@@ -59,4 +59,5 @@ $(document).on 'select2:reinitialize', (event) ->
59
59
  $select.trigger('change')
60
60
  true
61
61
 
62
-
62
+ $(document).on 'reset', 'form', (event) ->
63
+ $(event.currentTarget).find('select').val('').trigger('change.select2')
@@ -9,7 +9,7 @@ module EffectiveBootstrapHelper
9
9
  # = collapse('already expanded', show: true) do
10
10
  # %p Something Expanded
11
11
 
12
- # collapse(items.length, class: 'btn btn-primary', card_class: 'mt-2') do
12
+ # collapse(items.length, class: 'btn btn-primary', class: 'mt-2') do
13
13
  # items.map { |item| content_tag(:div, item.to_s) }.join.html_safe
14
14
  # end
15
15
  def collapse(label, opts = {}, &block)
@@ -19,7 +19,7 @@ module EffectiveBootstrapHelper
19
19
  show = (opts.delete(:show) == true)
20
20
 
21
21
  link_opts = { 'data-toggle': 'collapse', role: 'button', href: "##{id}", 'aria-controls': "##{id}", 'aria-expanded': show }
22
- card_class = opts.delete(:card_class)
22
+ card_class = opts.delete(:class) || 'my-2'
23
23
 
24
24
  content_tag(:a, label, link_opts.merge(opts)) +
25
25
  content_tag(:div, id: id, class: ['collapse', ('show' if show)].compact.join(' ')) do
@@ -19,11 +19,14 @@ module Effective
19
19
  end
20
20
 
21
21
  def logic_options
22
- { name: tag_name(args.first), value: args.second.to_s }
22
+ { name: tag_name(args.first), value: args.second.to_s }.merge(input_logic_options)
23
+ end
24
+
25
+ def input_logic_options
26
+ args.third.kind_of?(Hash) ? args.third : {}
23
27
  end
24
28
 
25
29
  def validate!(args)
26
- raise 'expected two arguments' unless args.length == 2
27
30
  raise "expected object to respond to #{args.first}" unless object.respond_to?(args.first)
28
31
  end
29
32
 
@@ -19,11 +19,14 @@ module Effective
19
19
  end
20
20
 
21
21
  def logic_options
22
- { name: tag_name(args.first), value: args.second.to_s }
22
+ { name: tag_name(args.first), value: args.second.to_s }.merge(input_logic_options)
23
+ end
24
+
25
+ def input_logic_options
26
+ args.third.kind_of?(Hash) ? args.third : {}
23
27
  end
24
28
 
25
29
  def validate!(args)
26
- raise 'expected two arguments' unless args.length == 2
27
30
  raise "expected object to respond to #{args.first}" unless object.respond_to?(args.first)
28
31
  end
29
32
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.6.6'.freeze
2
+ VERSION = '0.6.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
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: 2019-07-30 00:00:00.000000000 Z
11
+ date: 2019-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails