jeffchan/truncate.js — pull request #4 by aron (2013-09-10 17:29:28+00:00)
Title: Modify .update() to work when called on an expanded container.

Now rather than always truncating when calling .update() we update the cached property as before but if the content was originally expanded we restore it at the end of the method.

We also split out the collapsed and truncated states into separate variables as they are individual properties of the object. It is sometimes useful to know when the content is truncated even though it is expanded for example.

This pull makes it much easier to recalculate truncations when the window is resized.

```js
jQuery(window).on('resize', function () { $truncated.truncate('update'); });
```