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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/esvg/svg.rb +11 -8
- data/lib/esvg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94022733b5b1b8ff522fcd0c3ac93f37acfc91f7
|
4
|
+
data.tar.gz: 43874c5327983fa8d84c53aedc78dbc53669dd6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bfd0718123299977f3fe0ed00ee1c80deb278ef981ec5c3a0eb8dcbc42760e7d4b045927bc5fd53896829cb118c9190066359a29e77b4caead8b695d2b9c6b5
|
7
|
+
data.tar.gz: ea6348ffcefc875da7e45a6023ca400cc1bff150dc53ec9df848a460c232d73b27add1b3065e7511a20236f77d07a9495e2eadcf02cf7e1eeb93fba104387fa5
|
data/CHANGELOG.md
CHANGED
data/lib/esvg/svg.rb
CHANGED
@@ -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
|
-
//
|
218
|
-
|
219
|
+
// Handle Turbolinks (or other things that fire page change events)
|
220
|
+
document.addEventListener("page:change", function(event) { this.embed() })
|
219
221
|
|
220
|
-
// Handle
|
221
|
-
document.addEventListener("
|
222
|
+
// Handle standard DOM ready events
|
223
|
+
document.addEventListener("DOMContentLoaded", function(event) { this.embed() })
|
224
|
+
}
|
225
|
+
}
|
222
226
|
|
223
|
-
|
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 }
|
data/lib/esvg/version.rb
CHANGED