kugaevsky / jquery-phoenix

Phoenix is a jQuery plugin that saves form state to Local Storage via HMTL5 Web Storage APIs
http://kugaevsky.github.io/jquery-phoenix/
MIT License
164 stars 29 forks source link

Change from setInterval to change events #3

Open netsi1964 opened 10 years ago

netsi1964 commented 10 years ago

Thank you for sharing!

I know that the setInterval solution works, but I just believe that a approach where you listen for changes would perhaps be a better approach.

chriscct7 commented 10 years ago

I agree with this. Maybe make it an option to have it both ways?

bjerzyna commented 10 years ago

I created a fork and pull request for a change that implements this. It's a two liner in coffee.

kugaevsky commented 10 years ago

Listening to changes quite hard to implement because of compatibility with other plugins like chosen.js and select2 for example. Simple approach to listen to change event works from time to time if you are using custom form elements. But if you implement it as an option I will merge it with pleasure.