Throttle rendering of the preview.
Throttle rendering of the preview.

Summary:
Now typing in the editor is reponsive again!

- Call ItemRenderer.render() once, instead of once per hint.
- Throttle rendering to once per 50ms, instead of once per keystroke.

Test Plan:
locally, Chrome/OS X
- mash keys in one of the hint boxes in /test.html; see hint update
- type slowly in one of the hint boxes in /test.html; see no keystrokes dropped

Reviewers: alpert

Reviewed By: alpert

CC: eater

Differential Revision: http://phabricator.khanacademy.org/D2132

junyiacademy/perseus,ariabuckles/perseus,abe4mvp/perseus,sachgits/perseus,huangins/perseus,chirilo/perseus,iamchenxin/perseus,daukantas/perseus,sachgits/perseus,abe4mvp/perseus,junyiacademy/perseus,huangins/perseus,ariabuckles/perseus,alexristich/perseus,ariabuckles/perseus,alexristich/perseus,learningequality/perseus,daukantas/perseus,learningequality/perseus,iamchenxin/perseus,ariabuckles/perseus,chirilo/perseus