bgrins/ExpandingTextareas — pull request #38 by domchristie (2014-01-27 00:09:42+00:00)
Title: Refactor to use constructor pattern

This PR refactors the plugin to use the constructor pattern. It supercedes #37.

Apologies: there’s a lot going on. It seemed to make the most sense to bundle it as one PR.

- renamed jQuery method to `.expanding()`
- renamed CSS class names (`.expanding`, `.expanding-wrapper`, `.expanding-clone`)
- removed `.expanding-init` class name in favour of storing initialised textareas in an array `Expanding._registry`.
- added `$('textarea').expanding('isExpanding')` method to check for expanding behaviour
- used `span` + `br` instead of `div` in clone: removes trailing `' '`, and improves testability
- removed `$('textarea').expanding('resize')` method, it was not documented, and didn’t do much more than: `$('textarea').trigger('input') (?)
- renamed `resize` to `update`, (more descriptive, and avoids confusion with `window.onresize`)
- only bind to `keyup` event if input not supported to prevent excessive update calls
- unbind events on destroy
- remove scrollbars in IE with `overflow: auto` (scrollbars will still appear when height exceeds `max-height` e.g.)

There is one failing tests in IE8 (minor min-height discrepency), and one failing in IE9 (clone border top/bottom width off by 1px). Neither seem to affect the perceived behaviour.

I totally understand if it’s too much, but thought I’d get it out there.