smidwap/wysihtml5_size_matters — pull request #4 by brettjonesdev (2013-08-15 18:26:56+00:00)
Title: Add option for interval-based adjustment to catch programmatic editing

Currently, if your application dynamically alters the contents of the editor with JavaScript, the plugin does *not* detect this change and fails to adjust height accordingly.

This is because wysihtml5 uses an iframe with a `

`. Unlike `` tags, there is no `change` event that gets fired for `contenteditable` elements. Although there is currently a W3C spec for an `input` event, support at this time seems to be limited.

The other way to ensure that height gets adjusted consistently is to rely on a timer/ `setInterval()` system. I have made changes to the plugin (which my team is using in production now) which allow you to use a timer instead of the default onkeyup, onkeydown, event-driven method.

Can now be used like so:

```js
$(editor.composer.iframe).wysihtml5_size_matters({ useTimer: true });
.
.
.
$(editor.composer.iframe).wysihtml5_size_matters("stopTimer");
```

Default behavior is unchanged.