volt-fields 0.0.2 → 0.0.4

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: 0edba0c7d1b259011f12dc3e644c9e3c7f3d0bd4
4
- data.tar.gz: 695b7d5b7b817c62c7a1600638f89a0d25f60f1f
3
+ metadata.gz: ec3d312840f50bd0ce4c7d2b0d36e490b8600d75
4
+ data.tar.gz: f9b86cf5eaa1753c8761a8bd1dddd7b4c6b45880
5
5
  SHA512:
6
- metadata.gz: e9c2992fb555452a6b14aafa0b2f91d3f06598b81f186e66a25ad021f77e9a5f79cdb1d2c454e6b88d131aaa78883a3f1b55523c9706ddb8c8fcd4286eeaaa02
7
- data.tar.gz: ce579c4aa1e6592e5803fec4a0930ce2e7fbaeb20ddf6357f8779789cdad1db283c191b2ca0dc67f5d7abb07c9782a098983c49fe30d06b1cf474d3517f128cb
6
+ metadata.gz: 78adcf7894c5be220aeac9b137a1800e63ceb89b4250d456f91b610173c441dac8c8249e9ff00f513014f6f96dd528cc441740e68b807079265b8d7ec866226c
7
+ data.tar.gz: e151e43852dd794da867489750849e412fb843502b3cab6a302fa00d8c53c4db0f2964548a92a9b5c6eb1e1f82e42f9b62c0c5e7c2cd6624bbe911840dda1a23
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.4
@@ -1,5 +1,6 @@
1
1
  module Fields
2
2
  class TextController < ModelController
3
+ reactive_accessor :blurred
3
4
  def index
4
5
  # Default to text fields
5
6
  @type ||= 'text'
@@ -20,8 +21,10 @@ module Fields
20
21
  end
21
22
 
22
23
  # When a field goes out of focus, then we want to start checking a field
23
- def blurred
24
+ def blur
24
25
  @model.mark_field!(@field_name)
26
+
27
+ self.blurred = true
25
28
  end
26
29
  end
27
30
  end
@@ -1,10 +1,13 @@
1
1
  <:Body>
2
- <div class="form-group {#if @errors}has-error{/}">
2
+ <div class="form-group {#if @errors}has-error{#elsif blurred}has-success{/} has-feedback">
3
3
  {#if @label}
4
4
  <label class="control-label">{@label}</label>
5
5
  {/}
6
- <input type="{@type}" value="{@value}" e-focusout="blurred" class="form-control" />
6
+ <input type="{@type}" value="{@value}" e-focusout="blur" class="form-control" />
7
7
  {#if @errors}
8
+ <span class="glyphicon glyphicon-remove form-control-feedback"></span>
8
9
  <span class="control-label errors">{@errors.or([]).join(', ')}</span>
10
+ {#elsif blurred}
11
+ <span class="glyphicon glyphicon-ok form-control-feedback"></span>
9
12
  {/}
10
13
  </p>
@@ -1,10 +1,13 @@
1
1
  <:Body>
2
- <p class="form-group {#if @errors}has-error{/}">
2
+ <p class="form-group {#if @errors}has-error{#elsif blurred}has-success{/} has-feedback">
3
3
  {#if @label}
4
4
  <label class="control-label">{@label}</label>
5
5
  {/}
6
- <textarea e-focusout="blurred" class="form-control">{@value}</textarea>
6
+ <textarea e-focusout="blur" class="form-control">{@value}</textarea>
7
7
  {#if @errors}
8
+ <span class="glyphicon glyphicon-remove form-control-feedback"></span>
8
9
  <span class="control-label errors">{@errors.or([]).join(', ')}</span>
10
+ {#elsif blurred}
11
+ <span class="glyphicon glyphicon-ok form-control-feedback"></span>
9
12
  {/}
10
13
  </p>
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.2
4
+ version: 0.0.4
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-03-15 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: volt