hauleth / vanilla-ujs

UJS without jQuery dependency
MIT License
194 stars 24 forks source link

Check this out #1

Closed Paxa closed 10 years ago

Paxa commented 10 years ago

I stupidly didn't see how the testing done in https://github.com/rails/jquery-ujs, so I copy solution from activeadmin.

Simple how it works: when we run rspec -

For development purpose we can run rake setup and rake test_server, it will start server (same as rails server)


I also implemented few things of rails-ujs, I think if we bind one event on document object and then checking e.target on each click - it will initialize faster and works well with dynamic content, also no need to implement domready. But I think not all features are easy to do with global event. So I also found short cross-browser implementation of $(document).ready().


Updated

I never used a[data-remote], so I'm not sure if I implement it right

hauleth commented 10 years ago

It will be nice if You will split this into different pull-requests.

hauleth commented 10 years ago

As you can see I've use pure Node.js stack. Also I've splitted each functionality to separate file.