edx/edx-platform — pull request #664 by pbaratta (2013-08-13 17:43:25+00:00)
Title: Fix initial loading bug on `<formulaequationinput />`

The Problem
-----
`` input type is a math input type. Like other inputs, it persists the last submitted answer (i.e. when the student loads the section/page again, that answer shows up). We expect that answer to be shown in the preview box on page load. Prior to the fix, it was showing up as an empty box, until somebody typed.

I must have introduced this error during the initial PR process and noticed it too late.

Changes
---------
Change the `MathJax.Hub.Queue(initializeRequest)` to a simpler function call (`initializeRequest.call(this)`). It was failing to give a proper context to initializeRequest, so `this.value` was turning up as `undefined`.

Also add a fallback if we need to display some code before MathJax finishes its original typesetting.

The main changes (in terms of line numbers) are in my jasmine tests--I'm stubbing out MathJax, so the tests had to be changed around a little to get it to actually test what I want.

Reviewers
-------
* @polesye
* @singingwolfboy

Would you mind taking a look at this?