cutlass_js_rails 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/cutlass/html_generation.js +10 -2
- data/app/assets/javascripts/cutlass.js +1 -1
- data/app/assets/stylesheets/_cutlass.scss +16 -1
- data/app/views/cutlass/_date_field.html.erb +2 -0
- data/app/views/cutlass/_link_field.html.erb +1 -0
- data/app/views/cutlass/_select_field.html.erb +2 -0
- data/app/views/cutlass/_text_field.html.erb +3 -0
- data/app/views/cutlass/_toggle_field.html.erb +5 -0
- data/lib/cutlass_js_rails/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24afb5c43746fc605ab92cad707d2928f1e86da3
|
4
|
+
data.tar.gz: 52f6ff2bd4db9989b37269e8ca6dbe9815a2d8ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33913f4b030ee559586ee482013ea5c1af67a75678071e76a77df2750f63ac3958e0f83834a7d9d9024b76b7f52e29b5ff7e4748e7e5387279aa8f1b92c7beb4
|
7
|
+
data.tar.gz: 1f0afeacf74d0c6024e413f6cb043788bf1931b654d4204be1f369ae1f9eb48c9374b1334996dc621d9697429e8c5969377f01d92e81e953c7bbd12ab6820fa6
|
@@ -10,6 +10,7 @@ Cutlass.generateHTML = function(inputTypes){
|
|
10
10
|
$('.Cutlass-input-' + inputType).each(function(){
|
11
11
|
Cutlass.wrapInItem($(this), 'm-' + inputType)
|
12
12
|
Cutlass.addLabel($(this))
|
13
|
+
Cutlass.addError($(this))
|
13
14
|
Cutlass.ifAlwaysActive($(this))
|
14
15
|
})
|
15
16
|
})
|
@@ -23,10 +24,17 @@ Cutlass.wrapInItem = function($el, cssClass){
|
|
23
24
|
$div.append($input)
|
24
25
|
}
|
25
26
|
Cutlass.addLabel = function($input){
|
26
|
-
var
|
27
|
-
var $label = $('<div class="Cutlass-label">' +
|
27
|
+
var text = $input.data('label');
|
28
|
+
var $label = $('<div class="Cutlass-label">' + text + '</div>')
|
28
29
|
$input.before($label)
|
29
30
|
}
|
31
|
+
Cutlass.addError = function($input){
|
32
|
+
var text = $input.data('error');
|
33
|
+
if(text){
|
34
|
+
var $error = $('<div class="Cutlass-error Tooltip m-orange">' + text + '</div>');
|
35
|
+
$input.before($error)
|
36
|
+
}
|
37
|
+
}
|
30
38
|
Cutlass.ifAlwaysActive = function($input){
|
31
39
|
if($input.data('always-active')){
|
32
40
|
$input.parent().addClass('m-always-active')
|
@@ -2,7 +2,7 @@ $left-padding: 30px !default;
|
|
2
2
|
$right-padding: 15px !default;
|
3
3
|
$cutlass-border-color: #e4e4e4 !default;
|
4
4
|
$cutlass-label-color: #080808 !default;
|
5
|
-
$cutlass-label-opacity: .
|
5
|
+
$cutlass-label-opacity: .3;
|
6
6
|
$cutlass-active-label-color: #080808 !default;
|
7
7
|
$cutlass-input-color: #080808 !default;
|
8
8
|
$cutlass-link-color: #ff7c14 !default;
|
@@ -15,6 +15,9 @@ $cutlass-link-color: #ff7c14 !default;
|
|
15
15
|
position: relative;
|
16
16
|
min-height: 60px;
|
17
17
|
border-bottom: 1px solid $cutlass-border-color;
|
18
|
+
&.m-last{
|
19
|
+
border-bottom: 0;
|
20
|
+
}
|
18
21
|
}
|
19
22
|
.Cutlass-label{
|
20
23
|
color: $cutlass-label-color;
|
@@ -112,6 +115,18 @@ $cutlass-link-color: #ff7c14 !default;
|
|
112
115
|
}
|
113
116
|
}
|
114
117
|
|
118
|
+
// ========================================================
|
119
|
+
// ERRORS
|
120
|
+
// ========================================================
|
121
|
+
.Cutlass-error{
|
122
|
+
position: absolute;
|
123
|
+
top: -10px;
|
124
|
+
left: 50%;
|
125
|
+
transform: translateX(-50%);
|
126
|
+
font-size: 14px;
|
127
|
+
}
|
128
|
+
|
129
|
+
|
115
130
|
// ========================================================
|
116
131
|
// MODIFIERS
|
117
132
|
// ========================================================
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<% css_classes = (defined? css_classes) ? css_classes : '' %>
|
2
|
+
<%= f.text_field field, class: "Cutlass-input-text js-birthday-input #{css_classes}", value: Chronic.parse(@user._date_of_birth, endian_precedence: [:little])&.strftime('%Y-%m-%d'), 'data-label': label, type: 'tel', 'data-always-active': true, 'data-error': @user.errors[field][0] %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= link_to label, path, class: 'Cutlass-input-link' %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutlass_js_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chardos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,6 +55,11 @@ files:
|
|
55
55
|
- app/assets/javascripts/cutlass/helpers.js
|
56
56
|
- app/assets/javascripts/cutlass/html_generation.js
|
57
57
|
- app/assets/stylesheets/_cutlass.scss
|
58
|
+
- app/views/cutlass/_date_field.html.erb
|
59
|
+
- app/views/cutlass/_link_field.html.erb
|
60
|
+
- app/views/cutlass/_select_field.html.erb
|
61
|
+
- app/views/cutlass/_text_field.html.erb
|
62
|
+
- app/views/cutlass/_toggle_field.html.erb
|
58
63
|
- bin/console
|
59
64
|
- bin/setup
|
60
65
|
- cutlass_js_rails.gemspec
|
@@ -80,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
85
|
version: '0'
|
81
86
|
requirements: []
|
82
87
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.6.4
|
84
89
|
signing_key:
|
85
90
|
specification_version: 4
|
86
91
|
summary: Cuts down the size of inputs by reducing the prominence of labels once a
|