volt-fields 0.0.9 → 0.0.10

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: e283e9f0e54d5b59774ac712f44b5d4bedb95c43
4
- data.tar.gz: 14ce598495371c4ca63777bd93afdaa380bffb8c
3
+ metadata.gz: 3000ef89135d19d93015f9676b2258d30366b99b
4
+ data.tar.gz: ef005d240671aaa5bcff49626c372442f68c1492
5
5
  SHA512:
6
- metadata.gz: ab370ac372f72614f33030bcea7e7bf70c4d65582b40b5715aa38ded162838a39c85bb8f70d724f814be7e7b731a3e83ba313d2a9e9d6509353de236ec910f6e
7
- data.tar.gz: 35ff0a89d4f41bb411e2bf49c9b3709035db1458b676c46b032fc72d5938d8887894e664c4523bc198fda6804b5f6e0e01ce3eb3b704759f9e15d56c538642bc
6
+ metadata.gz: fca8794895003c6e88f9eb1b0d16459e7bbb78365709544a75f8a029d12d7bd4df6b1e3ede8e7ea166bcc4ab5bc9ba15bdff7633d87420181786f185e1dd1f20
7
+ data.tar.gz: e8fb9b8e169dff61c0ccb063854baf68fab4c89ad27672c6b547794db13ded147d652d514d8ac4a327ee975b0896f40b56706154e4ca5f83d0eb66d1da3f5d77
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
@@ -1,7 +1,5 @@
1
1
  module Fields
2
2
  class TextController < Volt::ModelController
3
- reactive_accessor :blurred
4
- reactive_accessor :errors
5
3
  def index
6
4
  # Default to text fields
7
5
  if attrs.respond_to?(:type)
@@ -15,7 +13,7 @@ module Fields
15
13
  @model = attrs.value_parent
16
14
 
17
15
  # Get the name of the field by looking at the method scope
18
- @field_name = attrs.value_last_method
16
+ @field_name = attrs.value_last_method.gsub(/^[_]/, '')
19
17
 
20
18
  end
21
19
 
@@ -37,8 +35,10 @@ module Fields
37
35
  # When a field goes out of focus, then we want to start checking a field
38
36
  def blur
39
37
  @model.mark_field!(@field_name)
38
+ end
40
39
 
41
- self.blurred = true
40
+ def marked
41
+ @model.marked_fields[@field_name]
42
42
  end
43
43
  end
44
44
  end
@@ -1,5 +1,5 @@
1
1
  <:Body>
2
- <div class="form-group {{ if errors }}has-error{{ elsif blurred }}has-success{{ end }} has-feedback">
2
+ <div class="form-group {{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback">
3
3
  {{ if label }}
4
4
  <label class="control-label">{{ label }}</label>
5
5
  {{ end }}
@@ -7,7 +7,7 @@
7
7
  {{ if errors }}
8
8
  <span class="glyphicon glyphicon-remove form-control-feedback"></span>
9
9
  <span class="control-label errors">{{ errors.or([]).join(', ') }}</span>
10
- {{ elsif blurred }}
10
+ {{ elsif marked }}
11
11
  <span class="glyphicon glyphicon-ok form-control-feedback"></span>
12
12
  {{ end }}
13
13
  </div>
@@ -1,5 +1,5 @@
1
1
  <:Body>
2
- <p class="form-group {{ if errors }}has-error{{ elsif blurred }}has-success{{ end }} has-feedback">
2
+ <p class="form-group {{ if errors }}has-error{{ elsif marked }}has-success{{ end }} has-feedback">
3
3
  {{ if label }}
4
4
  <label class="control-label">{{ label }}</label>
5
5
  {{ end }}
@@ -7,7 +7,7 @@
7
7
  {{ if errors }}
8
8
  <span class="glyphicon glyphicon-remove form-control-feedback"></span>
9
9
  <span class="control-label errors">{{ errors.or([]).join(', ') }}</span>
10
- {{ elsif blurred }}
10
+ {{ elsif marked }}
11
11
  <span class="glyphicon glyphicon-ok form-control-feedback"></span>
12
12
  {{ end }}
13
13
  </div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-18 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt