Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add an option to choose the path suffix for 2x images
  • Loading branch information
YuAo committed Nov 14, 2012
1 parent 5671145 commit 1304e63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/retina.js
Expand Up @@ -3,6 +3,9 @@
var root = (typeof exports == 'undefined' ? window : exports);

var config = {
// An option to choose a suffix for 2x images
retinaImageSuffix : "@2x",

// Ensure Content-Type is an image before trying to load @2x image
// https://github.com/imulus/retinajs/pull/45)
check_mime_type: true
Expand Down Expand Up @@ -54,7 +57,7 @@

function RetinaImagePath(path) {
this.path = path;
this.at_2x_path = path.replace(/\.\w+$/, function(match) { return "@2x" + match; });
this.at_2x_path = path.replace(/\.\w+$/, function(match) { return config.retinaImageSuffix + match; });
}

RetinaImagePath.confirmed_paths = [];
Expand Down

0 comments on commit 1304e63

Please sign in to comment.