noveogroup / backbone.iobind

Bind socket.io events to backbone models & collections. Also includes a drop-in replacement for Backbone.sync using socket.io.
https://noveogroup.github.io/backbone.iobind/
582 stars 65 forks source link

Added timeout option to sync methods. #67

Open MaffooBristol opened 9 years ago

MaffooBristol commented 9 years ago

Hello, I had noticed that timeouts weren't working on model and collection fetch/save/sync due to overriding jQuery's natural XHR methods. This PR should hopefully try and fix that issue and have it work the same way as normal AJAX based transport methods by using $.ajaxSetup({timeout: ms}) if it exists, or {timeout: ms} when syncing, if that exists, or no timeout if neither are specified.

Cheers :smile: Matt