cutlass_js_rails 0.3.9 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f114da0842e90ca332f98e9ce498ab76988b021
|
4
|
+
data.tar.gz: 0080d9db322981f5b9ac9c398ce923ae263b916f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 422d7ae217150f53ee0fe8769f77e9a68b9731540287bb59bc12957c35b60c27cfacf436d4b74d94e7b681716dad6d3ea7dd27f46e460de7be932f513a2c5307
|
7
|
+
data.tar.gz: 38ff92becc4faa17cceed7dba7604e89404e37f0053cdd0b184b97f60155008fc6e588b8966e068fe251bc743d9d4bd6ec9842a7bfe6b5fa808646531eb4b4d4
|
@@ -7,6 +7,7 @@ Cutlass.generateHTML = function(inputTypes){
|
|
7
7
|
$('.Cutlass-input-' + inputType).each(function(){
|
8
8
|
Cutlass.wrapInItem($(this), 'm-' + inputType)
|
9
9
|
Cutlass.addLabel($(this))
|
10
|
+
Cutlass.addDescription($(this))
|
10
11
|
Cutlass.addError($(this))
|
11
12
|
Cutlass.addWrapperClasses($(this))
|
12
13
|
Cutlass.ifAlwaysActive($(this))
|
@@ -27,6 +28,13 @@ Cutlass.addLabel = function($input){
|
|
27
28
|
var $label = $('<div class="Cutlass-label">' + text + '</div>')
|
28
29
|
$input.before($label)
|
29
30
|
}
|
31
|
+
Cutlass.addDescription = function($input){
|
32
|
+
var desc = $input.data('description');
|
33
|
+
if(desc){
|
34
|
+
var $desc = $('<div class="Cutlass-description">' + desc + '</div>')
|
35
|
+
$input.siblings('.Cutlass-label').append($desc)
|
36
|
+
}
|
37
|
+
}
|
30
38
|
Cutlass.addError = function($input){
|
31
39
|
var text = $input.data('error');
|
32
40
|
if(text){
|
@@ -2,6 +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-description: #6F7C82 !default;
|
5
6
|
$cutlass-label-opacity: .3;
|
6
7
|
$cutlass-active-label-color: #080808 !default;
|
7
8
|
$cutlass-input-color: #080808 !default;
|
@@ -31,6 +32,11 @@ $cutlass-link-color: #ff7c14 !default;
|
|
31
32
|
font-size: 15px;
|
32
33
|
opacity: $cutlass-label-opacity;
|
33
34
|
}
|
35
|
+
.Cutlass-description{
|
36
|
+
color: $cutlass-label-description;
|
37
|
+
transition: all .2s;
|
38
|
+
font-size: 15px;
|
39
|
+
}
|
34
40
|
%Cutlass-input{
|
35
41
|
border: 0;
|
36
42
|
font-size: 15px;
|
@@ -2,8 +2,10 @@
|
|
2
2
|
<% code = local_assigns.fetch(:code) %>
|
3
3
|
<% label = local_assigns.fetch(:label) %>
|
4
4
|
<% value = local_assigns.fetch(:value, '') %>
|
5
|
+
<% description = local_assigns.fetch(:description, '') %>
|
5
6
|
<%= f.check_box code, {
|
6
7
|
class: "Cutlass-input-toggler js-conditional-switch #{css_classes}",
|
7
8
|
checked: value == 'true',
|
8
|
-
'data-label': label
|
9
|
+
'data-label': label,
|
10
|
+
'data-description': description
|
9
11
|
}, 'true', 'false' %>
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chardos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|