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 +4 -4
- data/VERSION +1 -1
- data/app/fields/controllers/text_controller.rb +4 -1
- data/app/fields/views/text/index.html +5 -2
- data/app/fields/views/textarea/index.html +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec3d312840f50bd0ce4c7d2b0d36e490b8600d75
|
4
|
+
data.tar.gz: f9b86cf5eaa1753c8761a8bd1dddd7b4c6b45880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78adcf7894c5be220aeac9b137a1800e63ceb89b4250d456f91b610173c441dac8c8249e9ff00f513014f6f96dd528cc441740e68b807079265b8d7ec866226c
|
7
|
+
data.tar.gz: e151e43852dd794da867489750849e412fb843502b3cab6a302fa00d8c53c4db0f2964548a92a9b5c6eb1e1f82e42f9b62c0c5e7c2cd6624bbe911840dda1a23
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
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="
|
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="
|
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.
|
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-
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|