Closed xax closed 10 years ago
Thank you! Merged via f3b68bedf8ae5e0bd190606c0f2ed2f766c83793. I also fixed the whitespace issues and added a small notice into CHANGELOG. Thanks for contributing this, if you want to avoid the small issues with coding guidelines, let your editor use the editorconfig file :)
You want to enable the passing of an array of
selector
/fittype
definitions toobjectFit.polyfill
. If a lone object{ selector: 'img', fittype: 'cover' }
is passed, you wrap the object into an array.As code to determin if it is an array already that is passed, in
.init
you useif (typeof args !== 'Array') {…
– but that won't do it, as a JS array hastypeof [] === 'object'
. Thus I propose tio change the test to… instanceof Array
.(There are some EOL-whitespace diffs in this pull request – sorry about that.)