Open abdullahsalem opened 8 years ago
I like the direction - the JS should be easy enough to mix with other JS plugins without conflict. Would a global option to prefix the data-attributes be the best option?
I do think so, @rafibomb. While zf
would sure be future proof, as there is just a very little chance any other framework takes the same prefix, having it configurable would make totally sense. Of course having no prefix at all should be an option as well.
Maybe the default is no prefix, and you can configure one in your app if you need to. Wouldn't that help with backwards compatibility?
(Ack! Sorry. Butterfingers closed the issue.)
Thanks a lot for your participating guys.
I like your thoughts guys, yes I strongly agree that, it would be much better if they both are optional: the existing of the prefix, and its name. And the prefix name would be a good if it's zf
by default.
However, I think that will lead us to another question: Where should that configurations be? So far, there is no any global Foundation JavaScript APIs; What do you think if we have something like Foundation.defaults
in the global namespace?
Note: In this case, I think we should not wait for v7, because that will be compatible with the current major version, anyway!
Having a configuration file for those that build their custom Foundation with Gulp, etc. would be a good approach imo. I guess these configs could also be used/set in the $(document).foundation();
call on the fly by passing something like
$(document).foundation({
namespace: 'zf'
});
Note: In this case, I think we should not wait for v7, because that will be compatible with the current major version, anyway!
I only meant adding the prefix and its name, but the full solution that I mentioned in the proposal could be fully implemented in v7.
Here is the full solution:
- Adding a namespace to the data attribute of the plugin name and the plugin’s options, so the data attributes should look like: data-zf-plugin-name and data-zf-options.
- Removing the previous data individual options, and keep all the passed options in data-zf-options.
About the customizable namespace, I propose :
zf-
prefix advised in commentary.zf-
prefix as default in v7
@zurb/yetinauts Could you please review this proposal.