Skip to content

Commit

Permalink
Removed "false" to force IE mode
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Mar 3, 2014
1 parent fc5e835 commit 8931161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

.idea/*
.idea/*
grunt.js
6 changes: 3 additions & 3 deletions picturePolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ function responsiveImages() {
function parseSourceElement(sourceElement, ignoreMedia) {
var media, i, ratio, srcSetElements, srcSetElement, matchedSrc, srcSetAttribute;
media = sourceElement.getAttribute('media');
if (ignoreMedia || !media || matchMedia(media).matches) {
if (ignoreMedia || !media || window.matchMedia(media).matches) {
srcSetAttribute = sourceElement.getAttribute('srcset');
// Get the right source based on pixel ratio
srcSetElements = srcSetAttribute.split(',');
for (i=0; i<srcSetElements.length; i+=1) {
srcSetElement = srcSetElements[i].trim().split(' ');
ratio = parseInt(srcSetElement[1]) || 1;
ratio = parseInt(srcSetElement[1], 10) || 1;
if (ratio === pixelRatio) {
matchedSrc = srcSetElement[0];
}
Expand Down Expand Up @@ -57,7 +57,7 @@ function responsiveImages() {
pictureElement = pictureElements[i];

// If browser doesn't support matchMedia - NOTE: Paul Irish's polyfill is provided in "external/matchMedia.js"
srcAttribute = (false && window.matchMedia) ?
srcAttribute = (window.matchMedia) ?
parseSourceElements(pictureElement.getElementsByTagName('source'), false) :
parseSourceElement(pictureElement.querySelector('source[data-default]'), true);

Expand Down

0 comments on commit 8931161

Please sign in to comment.