conditionize2.js
conditionize2.js copied to clipboard
Feature Request: Support for global default options
I would like to suggest adding support for global default options, similar to how some jQuery plugins allow setting defaults via an object like $.conditionize.defaults.
This feature would allow developers to define default behaviors for conditionize2.js once, and have them applied across all instances, unless overridden locally.
For example:
$.conditionize.defaults = {
updateOn: 'change',
onload: true,
ifTrue: 'show',
ifFalse: 'hide'
};
Then, calling $('.my-element').conditionize(); would use these defaults.
Thanks for the suggestion. I like the idea. Currently, I can't promise to make it in a near future. Also, you are welcome if you want to add a PR with this feature and corresponding tests.