-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add global default params #72
feat: add global default params #72
Conversation
…o that it can be overwritten after the module is parsed Adds tests for overwriting the imgix-image component's default class
…config Adds tests for disabling/enabling the debug param from the application config
…nfig Adds tests for using them and how they will be merged into the src Adds notes to readme
Hey @Duder-onomy I'm currently taking a hiatus from imgix as I complete my university degree - I'm aiming to be back on board sometime later this year. Until that point, Jason (@jayeb) from imgix is the man you should reach out to for PR reviews or other questions! Anywho, I've given this a look over and it seems fine to me. @jayeb or @sherwinski should probably give this a review as well before it's merged, as they're more in-sync with imgix's internal plans. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I do have a question about the fallback for setting classes.
@@ -339,6 +341,10 @@ export default Component.extend({ | |||
return placeholderURL; | |||
}), | |||
|
|||
elementClassNames: computed('config.APP.imgix.classNames', function() { | |||
return config.APP.imgix.classNames || 'imgix-image'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there ever be a case where someone would want no default class on the img element? This || 'imgix-image'
would make it impossible to unset this option entirely.
I wanted to be able to specify some default params from the applications config. Specifically, I wanted the
auto='format'
param. While implementing, I noticed the other global config options were untested so I added some tests for those while I was in there.Description
debug
,classNames
,disableLibraryParam
]defaultParams
which is an object of default params that will be applied to allsrc
's.New Feature
Steps to Test