Created
November 3, 2015 18:41
-
-
Save bookwyrm/056d8464cc3525b5f4bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('data-type', function(arg) { | |
if ( arg.indexOf('image/svg') !== -1 ) { | |
return 'svg'; | |
} else if ( arg.indexOf('image/png') !== -1 ) { | |
return 'png'; | |
} else { | |
return 'png-fallback'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment