esvg 2.2.3 → 2.2.4

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: e6df8f118f74c6a07e847ad3af6d6e254ebac1a5
4
- data.tar.gz: 5ba5fe47e56750908bc40546f081bdca5fd2c974
3
+ metadata.gz: 94022733b5b1b8ff522fcd0c3ac93f37acfc91f7
4
+ data.tar.gz: 43874c5327983fa8d84c53aedc78dbc53669dd6c
5
5
  SHA512:
6
- metadata.gz: 4be85aa23f362fcdc850d1e4abfa5c8c64165a5b853cf4fff2d8208caca5c8ae794c0d8f14bdbb255345123ac14be2af2fc3c5f731080fc9004bc1eda8d8f630
7
- data.tar.gz: 7bcf746b645e883294fdab8746980b66de163cf5a54c4450f74b834e1935a9dc73f18eab2c99cfc67484b60606ab3e4aef889e025ba19986f91fc599b6258c34
6
+ metadata.gz: 5bfd0718123299977f3fe0ed00ee1c80deb278ef981ec5c3a0eb8dcbc42760e7d4b045927bc5fd53896829cb118c9190066359a29e77b4caead8b695d2b9c6b5
7
+ data.tar.gz: ea6348ffcefc875da7e45a6023ca400cc1bff150dc53ec9df848a460c232d73b27add1b3065e7511a20236f77d07a9495e2eadcf02cf7e1eeb93fba104387fa5
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.2.4 (2015-10-02)
4
+ - Fix: Esvg load function happens inside of the module now
5
+
3
6
  ### 2.2.3 (2015-10-02)
4
7
  - Fix: Dasherize input when embedding icons from the ruby helper.
5
8
 
@@ -211,17 +211,20 @@ module Esvg
211
211
  },
212
212
  dasherize: function(input) {
213
213
  return input.replace(/[\W,_]/g, '-').replace(/-{2,}/g, '-')
214
- }
215
- }
214
+ },
215
+ load: function(){
216
+ // If DOM is already ready, embed SVGs
217
+ if (document.readyState == 'interactive') { this.embed() }
216
218
 
217
- // If DOM is already ready, embed SVGs
218
- if (document.readyState == 'interactive') { esvg.embed() }
219
+ // Handle Turbolinks (or other things that fire page change events)
220
+ document.addEventListener("page:change", function(event) { this.embed() })
219
221
 
220
- // Handle Turbolinks (or other things that fire page change events)
221
- document.addEventListener("page:change", function(event) { esvg.embed() })
222
+ // Handle standard DOM ready events
223
+ document.addEventListener("DOMContentLoaded", function(event) { this.embed() })
224
+ }
225
+ }
222
226
 
223
- // Handle standard DOM ready events
224
- document.addEventListener("DOMContentLoaded", function(event) { esvg.embed() })
227
+ esvg.load()
225
228
 
226
229
  // Work with module exports:
227
230
  if(typeof(module) != 'undefined') { module.exports = esvg }
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.2.3"
2
+ VERSION = "2.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis