peduarte / wallop

:no_entry: currently unmaintained :no_entry: A minimal JS library for showing & hiding things
1.1k stars 79 forks source link

Add destroy method #62

Closed thasmo closed 8 years ago

thasmo commented 8 years ago

25 mentions adding a destroy method. As I haven't found a destroy method in the codebase, I propose to add one, because it's a very useful feature when implementing Wallop in RWD projects.

peduarte commented 8 years ago

Merged, thanks!

magicspon commented 8 years ago

Hello,

Has a destory method been added? I can't see it in the source code.

Cheers

peduarte commented 8 years ago

hello, wallop has reset() method now which should be helpful when adding/removing items dynamically. Otherwise, CSS Media queries should be enough to turn the Slider into a Stacked list of items on mobile view.

essmahr commented 7 years ago

Hi! I'd like to revisit this if possible. I think a destroy method would be beneficial, here's my use case:

I'm using wallop in a situation the entire domNode is being replaced via ajax. I can't reset() because all original bindings have been wiped out, even though the new markup is identical. And with the current approach, I can't reinstantiate, because wallop is caching the current selector and so it throws the 'An instance of Wallop with this selector already exists.' error.

I'd like to explore either a destroy() method, or a change in the behaviour so that existing instances can be re-instantiated.

Thanks for a very logical, flexible library :)

honzabilek4 commented 7 years ago

Hi, I'd just like to say that this is closely related to issue #75.