cutlass_js_rails 0.4.10 → 0.5.2

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: af5714dc5e3ce1f645b928cfce89b09e0db3fc60
4
- data.tar.gz: 9f566d57bd0046f3cb810640e7fd7b525e5f7548
3
+ metadata.gz: 3519b2b2a8c788c3311a306c9e90dabb9c9ee312
4
+ data.tar.gz: ff84af7f7228d651fa58af0abc721eb5530b1573
5
5
  SHA512:
6
- metadata.gz: e2182224cc2d983f4fa774562f3d6ed6e8dabffd3a0be1337ad47f465ecc50eeb8cdb130d0b785511c74d9b5a1b8899b75e4be29bd0e0a51eb18fdd74b99a0d3
7
- data.tar.gz: bc3289360706b1c70e1a72f940927c8d87bae0e32257406fdb2da985ea9096dc62c9c5730b39bab56e1f7982c70e102a84dc262857ac9695ebeca9ccea182e55
6
+ metadata.gz: 814ba8afdce259dd768e454d805596215d915283e13d5e9686ce18f5b3eeb57cbc764f6caf08c9560c2160bf38623a4c94486a111c01869c99588beca09d8692
7
+ data.tar.gz: 29bebc7524b0e035087872e2572826db6dfcd71578473e15fbaa2c7f57218ded47be85ff8dc15586980ef90ca694a2fee1c5106a13e09e86d5608ea7ab8bae09
@@ -18,15 +18,23 @@ Cutlass.generateHTML = function(inputTypes){
18
18
 
19
19
  // HELPERS =====================
20
20
  Cutlass.wrapInItem = function($el, cssClass){
21
- var $div = $('<div class="Cutlass-item ' + cssClass + '"></div>');
22
- $el.before($div)
23
- var $input = $el.detach();
24
- $div.append($input)
21
+ $el.closest('.input').addClass('Cutlass-item ' + cssClass);
22
+ // var $div = $('<div class="Cutlass-item ' + cssClass + '"></div>');
23
+ // $el.before($div)
24
+ // var $input = $el.detach();
25
+ // $div.append($input)
25
26
  }
26
27
  Cutlass.addLabel = function($input){
27
- var text = $input.data('label');
28
- var $label = $('<div class="Cutlass-label">' + text + '</div>')
29
- $input.before($label)
28
+ // // var text = $input.data('label');
29
+ // var $label = $input.closest('.Cutlass-item').find('.Cutlass-label');
30
+ // console.log('label', $label);
31
+ // if($label.hasClass('outside-label')) {
32
+ // console.log('ahh');
33
+ // // $input.before($label)
34
+ // // $label.remove()
35
+ // } else {
36
+ // console.log('err');
37
+ // }
30
38
  }
31
39
  Cutlass.addDescription = function($input){
32
40
  var desc = $input.data('description');
@@ -37,9 +45,10 @@ Cutlass.addDescription = function($input){
37
45
  }
38
46
  Cutlass.addError = function($input){
39
47
  var text = $input.data('error');
40
- if(text){
41
- var $error = $('<div class="Cutlass-error Tooltip m-orange">' + text + '</div>');
42
- $input.before($error)
48
+ var $error = $input.closest('.input').next('.cutlass_error');
49
+ $error.remove();
50
+ if($error.find('.Cutlass-error').html() && $error.find('.Cutlass-error').html().length > 0) {
51
+ $input.before($error);
43
52
  }
44
53
  }
45
54
  Cutlass.removeError = function($input){
@@ -50,13 +59,13 @@ Cutlass.addWrapperClasses = function($input){
50
59
  if(classes){
51
60
  classes = classes.split(' ');
52
61
  classes.forEach(function(klass){
53
- $input.parent().addClass(klass)
62
+ $input.closest('.input').addClass(klass)
54
63
  })
55
64
  }
56
65
  }
57
66
  Cutlass.ifAlwaysActive = function($input){
58
67
  if($input.data('always-active')){
59
- $input.parent().addClass('m-always-active')
68
+ $input.closest('.input').addClass('m-always-active')
60
69
  }
61
70
  }
62
71
  Cutlass.addFlag = function(){
@@ -154,6 +154,7 @@ $cutlass-link-color: #ff7c14 !default;
154
154
  .Cutlass-label{
155
155
  opacity: 1;
156
156
  padding: 18px ($right-padding+60) 19px $left-padding;
157
+ display: block;
157
158
  }
158
159
  .switchery{
159
160
  position: absolute;
@@ -166,9 +167,11 @@ $cutlass-link-color: #ff7c14 !default;
166
167
  // RADIO INPUT
167
168
  // ========================================================
168
169
  .m-radio{
170
+ padding: 18px $right-padding 13px $left-padding;
169
171
  .Cutlass-label{
170
172
  opacity: 1;
171
- padding: 18px $right-padding 13px $left-padding;
173
+ display: block;
174
+ padding: 0 0 13px 0;
172
175
  }
173
176
  .Cutlass-input-radio{
174
177
  padding: 0 15px 25px 30px;
@@ -223,6 +226,13 @@ $cutlass-link-color: #ff7c14 !default;
223
226
  }
224
227
  }
225
228
 
229
+ .input.dob {
230
+ .Cutlass-label{
231
+ font-size: 12px;
232
+ transform: translateY(-6px);
233
+ }
234
+ }
235
+
226
236
  // ========================================================
227
237
  // STATES
228
238
  // ========================================================
@@ -1,3 +1,3 @@
1
1
  module CutlassJsRails
2
- VERSION = '0.4.10'
2
+ VERSION = '0.5.2'
3
3
  end
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.10
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chardos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-08 00:00:00.000000000 Z
11
+ date: 2016-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler