simple_form_nested_fields 0.2.0 → 0.2.1

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: c3825b7065d43cc16961e608d038f72a95f0f193ff7ae1ad9cf3fb0876aa45a4
4
- data.tar.gz: 030cb2f571a71e38aab4a43084885a0daab9765358256e16d13228539f688415
3
+ metadata.gz: 6503b66d302d584519904f940376f2d31dad4c1d8b70ed35f21e1b18949236db
4
+ data.tar.gz: 944ab3847f631786be2f648c99c0cff69def74146edc9fe6065e61c2cd3691ca
5
5
  SHA512:
6
- metadata.gz: f4a96954435c4b63181922c6ae172ccb28c94ecc5b9160faaebfbc4a08ce51f9de2a8d451d361e9e1068e8d88d21a359050e9e95fbbff20d0cbcc709e8076dfb
7
- data.tar.gz: 83df06bf03db19f59e58ed4d6bcf0aa1b33d53731d7c2192583e0c65a8ff777e6b7a177365595111f5df78683d558444165cc9e126411618a1eb950f3701f0a6
6
+ metadata.gz: ad749bc8d209f5c081b3228a7139bd4e4038e08ebb1057c68ee487fb28bfe07885d7be2b9fba2f289b3c9fb8ab3c40ef82b37600afd8c34a531aa20edebfb9cc
7
+ data.tar.gz: d92e37368e2f8db9e85c52d554c2f4cc82f05a5b84f8eee29141bffcba6c09cf9da5dc1e944dfec3ec7ab7754aea007a16c75eb1ab6c89e23a74ccb8309abbff
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.1
4
+
5
+ * [PR#3](https://github.com/tomasc/simple_form_nested_fields/pull/3) fix duplicate dom classes
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  * [PR#1](https://github.com/tomasc/simple_form_nested_fields/pull/1) refactor DOM class names to closely follow the `bem` spec (i.e. `.simple_form_nested_fields__link--add`)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_nested_fields (0.2.0)
4
+ simple_form_nested_fields (0.2.1)
5
5
  coffee-rails
6
6
  simple_form
7
7
 
@@ -19,10 +19,7 @@ module SimpleFormNestedFields
19
19
  def_delegators :template, :concat, :content_tag, :hidden_field_tag, :link_to, :render
20
20
 
21
21
  def nested_fields_for
22
- dom_class = [bem_class, bem_class(m: record_name)]
23
- dom_class << bem_class(m: :sortable) if is_sortable?
24
-
25
- content_tag(:div, class: dom_class) do
22
+ content_tag(:div, class: wrapper_class) do
26
23
  concat nested_fields_title
27
24
  concat nested_fields_items
28
25
  concat nested_fields_links
@@ -31,6 +28,11 @@ module SimpleFormNestedFields
31
28
 
32
29
  private
33
30
 
31
+ def wrapper_class
32
+ modifiers = is_sortable? ? [record_name, :sortable] : record_name
33
+ bem_class(m: modifiers)
34
+ end
35
+
34
36
  def is_sortable?
35
37
  options[:sortable] == true
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormNestedFields
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple_form_nested_fields",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "…",
5
5
  "main": "package/dist/index.js",
6
6
  "repository": "https://github.com/tomasc/simple_form_nested_fields.git",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_nested_fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-12-20 00:00:00.000000000 Z
12
+ date: 2018-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simple_form