conditionize2.js icon indicating copy to clipboard operation
conditionize2.js copied to clipboard

Feature Request: Support for global default options

Open crmb opened this issue 9 months ago • 1 comments

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.

crmb avatar May 14 '25 17:05 crmb

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.

rguliev avatar Jun 04 '25 08:06 rguliev