-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow multiple classes for the same selector #1
Comments
Implementation could be fairly easy, as you know: we could allow the But indeed, the pluton.call(fn, parameters).on(classname, selector); Where the second parameter of the |
Interesting proposition, however that is not what I meant. I meant we have on multiple occasions felt the need to have multiple JS classes that use the same query selector. The classic example is when you need to run a script on every page, so you target the body in the selector method. The current implementation of Pluton only runs the first of those JS classes and ignores the subsequent ones. Still not sure this is 100% needed as we could imagine workarounds to this example, but maybe there are other use cases where it would be handy. |
Yep, I understand it better now. But I still think the proposition above is a good answer to your initial issue. It will just need some other changes too. First, we could wrap every Class Instance in a The What would be really cool would be to have another method, similar to function myFunction(instance) {
// Do something with the given instance
}
pluton.callback(myFunction).on(classname, selector); |
We should look into this, see if it is doable, and think it through properly to be sure it makes sense.
One thing that could problematic is the
pluton.call
method which would not know which class to call stuff on.The text was updated successfully, but these errors were encountered: