-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi,
I've noticed an issue with this plugin patten. Public methods doesn't work when you pass a selector that target multiple objects. Below is an example where we create two instances of the plugin, first on a single element var single = new myPluginName('.js-single');, and then on multiple elements var multiple = new myPluginName('.js-multiple');.
If I trigger the public update() method on both of those instances, an error will be thrown on the multiple since the plugin returns an array containing all the objects for multiple.
https://jsfiddle.net/jLeu98oq/
Sure, we could loop through all the objects and trigger the update – https://jsfiddle.net/jLeu98oq/2/ – but isn't there a nicer solution?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels