documentcloud/backbone — pull request #2576 by todd (2013-05-30 22:06:58+00:00)
Title: Added toggle method for Backbone.Model

This PR adds a simple `toggle` method to `Backbone.Model`. It will toggle the value of any attribute passed in and then trigger a `"change"`.

```javascript
var book = new Backbone.Model({
available: true
});

book.toggle('available') // Sets available to false
```