Skip to content

Commit

Permalink
Releasing 2.0.4 - added native picture support detection
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Mar 19, 2014
1 parent c956f44 commit f13fc12
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function(grunt) {
grunt.initConfig({
// Metadata.
meta: {
version: '2.0.3'
version: '2.0.4'
},
banner: '/*! picturePolyfill - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "picturePolyfill",
"version": "2.0.3",
"version": "2.0.4",
"main": "picturePolyfill.js",
"ignore": [
".idea",
Expand Down
13 changes: 9 additions & 4 deletions picturePolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,15 @@
}
}

initialize();
// Check if picture is supported. If not, initialize module and expose picturePolyfill to the global namespace
// else expose an empty function to avoid errors when calling picturePolyfill

// Exposing picturePolyfill to the global environment,
// to gain the ability to call picturePolyfill on a slice of DOM (eg: after an AJAX call)
w.picturePolyfill = parsePictures;
if (!window.HTMLPictureElement) {
initialize();
w.picturePolyfill = parsePictures;
}
else {
w.picturePolyfill = function() {};
}

}(window));
4 changes: 2 additions & 2 deletions picturePolyfill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f13fc12

Please sign in to comment.