cutlass_js_rails 0.3.1 → 0.3.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: a37ea0e58c065d009dfad502c841dbbb9477e117
4
- data.tar.gz: b2605b1cd103e3fb6ee865b4071e9eac73c0740e
3
+ metadata.gz: 3d90504588161ea0fed9441845f7e4655fe18f80
4
+ data.tar.gz: 11a5a2b2efc91c5121bb25dc2dbc44f3ff5abecd
5
5
  SHA512:
6
- metadata.gz: 11533895e7cdf270927ae93d5f188309de83c357b21d765583264dd0a275bab040cdb3ead65ab9aef5f7d1d21dcda21dd4e0120394481e7696d54538627acbbe
7
- data.tar.gz: 0f9a04d1832b9b28d37ba55f050b488e6cb5a05227b092b57dc36079976cc751918486a9b742980c55471366bd1bd6e95455cbcf461ab41e44adb683f9eb8c9a
6
+ metadata.gz: e2c92752a41ad25674b431a8fe2e03a4ecff50687e6bb40c9292471de9a4ddd69b2e96666b1ac1e1cbf7186dc099f102521446603b999666c5e8c25b7312ea69
7
+ data.tar.gz: 99bad3e139a17143347a83b0f6fb04e6ac956173bf0451a2e90d4a1d4129203901b83a974021650a0657fe0dbd978a4c3278068328385ec6f43437b77c59a8bf
@@ -12,6 +12,7 @@ Cutlass.generateHTML = function(inputTypes){
12
12
  Cutlass.ifAlwaysActive($(this))
13
13
  })
14
14
  })
15
+ Cutlass.addFlag();
15
16
  }
16
17
 
17
18
  // HELPERS =====================
@@ -48,3 +49,10 @@ Cutlass.ifAlwaysActive = function($input){
48
49
  $input.parent().addClass('m-always-active')
49
50
  }
50
51
  }
52
+ Cutlass.addFlag = function(){
53
+ $('.Cutlass-item').eq(0).attr('data-cutlassed', true);
54
+ }
55
+ Cutlass.hasntRun= function(){
56
+ alert(!$('[data-cutlassed]').length)
57
+ return !$('[data-cutlassed]').length
58
+ }
@@ -1,7 +1,10 @@
1
1
  //= require cutlass/helpers
2
2
  //= require cutlass/html_generation
3
3
  document.addEventListener("turbolinks:load", function() {
4
- Cutlass.generateAllHTML()
4
+ if(Cutlass.hasntRun()){
5
+ Cutlass.generateAllHTML()
6
+ }
7
+ Cutlass.addFlag();
5
8
  Cutlass.animateFields()
6
9
 
7
10
  //TEXT INPUTS =========================================================
@@ -1,3 +1,3 @@
1
1
  module CutlassJsRails
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cutlass_js_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - chardos