retina_tag 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@ RetinaTag.init = function() {
7
7
  };
8
8
 
9
9
  RetinaTag.updateImages = function() {
10
+ console.log("UPDATING IMAGES!");
10
11
  var images = document.getElementsByTagName('img');
11
12
  for(var counter=0; counter < images.length; counter++) {
12
13
  if(!images[counter].getAttribute('data-lazy-load')) {
@@ -31,10 +32,14 @@ RetinaTag.refreshImage = function(image) {
31
32
  if(!lowDpiSrc) {
32
33
  image.setAttribute('lowdpi_src',imageSrc);
33
34
  }
35
+ console.log("Setting Source!");
34
36
  image.src = hiDpiSrc;
35
37
  }
36
- else if(window.devicePixelRatio <= 1 && (imageSrc == hiDpiSrc || (lowDpiSrc && imageSrc != lowDpiSrc))) {
38
+ else if((!window.devicePixelRatio || window.devicePixelRatio <= 1) && (imageSrc == hiDpiSrc || (lowDpiSrc && imageSrc != lowDpiSrc))) {
39
+ console.log("Setting low src");
37
40
  image.src = lowDpiSrc;
41
+ } else {
42
+ console.log("WHOOPS!");
38
43
  }
39
44
  };
40
45
 
@@ -1,3 +1,3 @@
1
1
  module RetinaTag
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retina_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  segments:
77
77
  - 0
78
- hash: -2618567540484132469
78
+ hash: -4033120622800566692
79
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  none: false
81
81
  requirements:
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  segments:
86
86
  - 0
87
- hash: -2618567540484132469
87
+ hash: -4033120622800566692
88
88
  requirements: []
89
89
  rubyforge_project:
90
90
  rubygems_version: 1.8.24