Merge pull request #10378 from edx/christina/fix-mathjax-preview

Disable Fast Preview for version 2.5.
This commit is contained in:
Christina Roberts
2015-10-29 12:41:30 -04:00
9 changed files with 69 additions and 28 deletions

View File

@@ -235,8 +235,7 @@ describe("Formula Equation Preview", function () {
// Refresh the MathJax.
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, 'THE_FORMULA'],
['Reprocess', this.jax]
['Text', this.jax, 'THE_FORMULA']
);
});
});
@@ -302,8 +301,7 @@ describe("Formula Equation Preview", function () {
runs(function () {
// Refresh the MathJax.
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, '\\text{OOPSIE}'],
['Reprocess', this.jax]
['Text', this.jax, '\\text{OOPSIE}']
);
expect($img.css('visibility')).toEqual('hidden');
});
@@ -349,17 +347,15 @@ describe("Formula Equation Preview", function () {
this.callbacks[0](this.responses[0]);
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, 'THE_FORMULA_0'],
['Reprocess', this.jax]
['Text', this.jax, 'THE_FORMULA_0']
);
expect($img.css('visibility')).toEqual('visible');
this.callbacks[1](this.responses[1]);
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, 'THE_FORMULA_1'],
['Reprocess', this.jax]
['Text', this.jax, 'THE_FORMULA_1']
);
expect($img.css('visibility')).toEqual('hidden')
expect($img.css('visibility')).toEqual('hidden');
});
it("doesn't display outdated information", function () {
@@ -370,15 +366,14 @@ describe("Formula Equation Preview", function () {
// Switch the order (1 returns before 0)
this.callbacks[1](this.responses[1]);
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, 'THE_FORMULA_1'],
['Reprocess', this.jax]
['Text', this.jax, 'THE_FORMULA_1']
);
expect($img.css('visibility')).toEqual('hidden')
expect($img.css('visibility')).toEqual('hidden');
MathJax.Hub.Queue.reset();
this.callbacks[0](this.responses[0]);
expect(MathJax.Hub.Queue).not.toHaveBeenCalled();
expect($img.css('visibility')).toEqual('hidden')
expect($img.css('visibility')).toEqual('hidden');
});
it("doesn't show an error if the responses are close together",
@@ -392,8 +387,7 @@ describe("Formula Equation Preview", function () {
this.callbacks[1](this.responses[1]);
expect(MathJax.Hub.Queue).toHaveBeenCalledWith(
['Text', this.jax, 'THE_FORMULA_1'],
['Reprocess', this.jax]
['Text', this.jax, 'THE_FORMULA_1']
);
// Make sure that it doesn't indeed show up later

View File

@@ -139,8 +139,7 @@ formulaEquationPreview.enable = function () {
if (inputData.jax) {
// Set the text as the latex code, and then update the MathJax.
MathJax.Hub.Queue(
['Text', inputData.jax, latex],
['Reprocess', inputData.jax]
['Text', inputData.jax, latex]
);
} else if (latex) {
console.log("[FormulaEquationInput] Oops no mathjax for ", latex);