julianshapiro/velocity — pull request #29 by nmussy (2014-05-03 14:32:51+00:00)
Title: Issue: $.velocity.animate($()) fails

This pull request resolves the following issue:

```javascript
// works
$.velocity.animate($('#test')[0], {'left': -525}, {
duration: 300,
easing: "swing",
});
// works
$('#test').velocity({'left': -525}, {
duration: 300,
easing: "swing",
});
// fails
$.velocity.animate($('#test'), {'left': -525}, {
duration: 300,
easing: "swing",
});
```

The plugin didn't check if the first given argument was a jQuery object, and just assumed raw.

From now on, we check both the context and the first argument. To avoid redundancy, we no longer assign variables to their respective arguments only according to the presence of jQuery, but assume the correct number of parameters was given, just that the elements were defined in the context (raw or jQuery.)