Skip to content
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

Plugin does not namespace data, event handlers, etc. #380

Open
doug65536 opened this issue Nov 17, 2013 · 1 comment
Open

Plugin does not namespace data, event handlers, etc. #380

doug65536 opened this issue Nov 17, 2013 · 1 comment
Milestone

Comments

@doug65536
Copy link

Correctly implemented jquery plugins namespace their event handlers and data. This plugin does not. The names used when getting/setting data are supposed to be namespaced, by following the name with a dot and a namespace name. Also, when attaching event handlers, a dot and namespace should be appended.

Examples:

something.data('whatever.bootstrapselect', that);

something.on('click.bootstrapselect', function() ...);

The above examples use bootstrapselect as the "namespace" for the data and event handler.

This avoids trampling on any data that the user of the plugin has set on elements, inadvertently reading data set by the user of the plugin, facilitates removing only event handlers that have been added by the plugin, and prevents the user from accidentally wiping out event handlers added by the plugin.

Please see the jquery plugin developer's guide.

@t0xicCode
Copy link
Collaborator

I had started that some time ago, and some of the events that we trigger use a namespace.

We have chosen bs.select as the namespace for events. However, we haven't decided of an approach for the namespacing of the data because we have to mind existing code.

@t0xicCode t0xicCode added this to the ng milestone Aug 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants