simple_form_password_with_hints 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: 6eded650894c5c64046bec10c0770af6613ff101df0422c18d4109ebebdb3b2f
4
- data.tar.gz: 65fe956b8f35a532ad47daf6a75d0b5de1bf23790af7e9ade84915553dad9d32
3
+ metadata.gz: 891b21002820e82ef116a1b150acfee6fc0134ee7330f710e3804a2ce0fdcd7a
4
+ data.tar.gz: 6cb703cc5b166a077d450af16a3f05fc4d004c440cb9980ca5f60dccf645b6f0
5
5
  SHA512:
6
- metadata.gz: 2e72ce9f0973ce9005f836abb08b50a521ea61c78398deac7866763731dfde78aea1a34ceae1c20245b3f6c64cadf6b00497b4fe2d5f7117aad084ca8dfccfaa
7
- data.tar.gz: 24e0346b43f8bbd43ab4aa88833f5c9649ebf16a384e3588c34e29d1a13c25015ea8903341903ac9a30f18c83b487d16ecf39c17a360cbf3d40f4bde57acd211
6
+ metadata.gz: 58beba01eee82e29dd3497cf101b397de049465564865a2730b632b6d2f9b23d98cca51ab2c97b6bf2ffb03caf1edf50c56b6e512b7b20bcbfb5b4590087edd5
7
+ data.tar.gz: 22521ab12a5d39ec5c1b10066ab49f8640bb2a3d740f32ccccc472d0d15da5905f15b20e29475f2c3643642be59c61d2b7aedaf410a4fa0c79b4cc83e83b981e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_password_with_hints (0.0.4)
4
+ simple_form_password_with_hints (0.0.5)
5
5
  rails
6
6
  simple_form
7
7
 
@@ -32,13 +32,21 @@ Element.prototype.parent = function (selector) {
32
32
 
33
33
  (function () {
34
34
  'use strict';
35
- var simpleFormPasswordWithHints = {
35
+ var initialized = false,
36
+ simpleFormPasswordWithHints;
37
+
38
+ simpleFormPasswordWithHints = {
36
39
  init: function () {
37
40
  var inputs = document.querySelectorAll('.js-sfpwh-hints-input'),
38
41
  togglers = document.querySelectorAll('.js-sfpwh-password-toggle'),
39
42
  syncInputs = document.querySelectorAll('.js-sfpwh-sync-input'),
40
43
  i = 0;
41
44
 
45
+ if (initialized) {
46
+ return false;
47
+ }
48
+ initialized = true;
49
+
42
50
  this.listen(inputs, 'input', this.onInput.bind(this));
43
51
  this.listen(togglers, 'click', this.onClickToggler);
44
52
 
@@ -140,7 +148,12 @@ Element.prototype.parent = function (selector) {
140
148
  return regex;
141
149
  }
142
150
  };
143
- document.addEventListener('DOMContentLoaded', function () {
151
+
152
+ if (document.readyState === 'complete' || document.readyState === 'interactive') {
144
153
  simpleFormPasswordWithHints.init();
145
- });
154
+ } else {
155
+ window.addEventListener('DOMContentLoaded', () => {
156
+ simpleFormPasswordWithHints.init();
157
+ });
158
+ }
146
159
  }());
@@ -1,3 +1,3 @@
1
1
  module SimpleFormPasswordWithHints
2
- VERSION = "0.0.4".freeze
2
+ VERSION = "0.0.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_password_with_hints
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-andré Boissinot