Don't cache the value of 'selected', since calls to isEmbellished() can be made before the expression is in place, and the values of displastyle and scriptlevel are known. Resolves issue #1053.

This commit is contained in:
Davide P. Cervone 2015-02-11 09:34:25 -05:00
parent cb13a059bb
commit b1a2b4fe03

View File

@ -45,14 +45,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
MML.TeXmathchoice = MML.mbase.Subclass({ MML.TeXmathchoice = MML.mbase.Subclass({
type: "TeXmathchoice", notParent: true, type: "TeXmathchoice", notParent: true,
choice: function () { choice: function (nocache) {
if (this.selection == null) { var selection = 0, values = this.getValues("displaystyle","scriptlevel");
this.selection = 0; if (values.scriptlevel > 0) {selection = Math.min(3,values.scriptlevel+1)}
var values = this.getValues("displaystyle","scriptlevel"); else {selection = (values.displaystyle ? 0 : 1)}
if (values.scriptlevel > 0) {this.selection = Math.min(3,values.scriptlevel+1)} return selection;
else {this.selection = (values.displaystyle ? 0 : 1)}
}
return this.selection;
}, },
selected: function () {return this.data[this.choice()]}, selected: function () {return this.data[this.choice()]},
setTeXclass: function (prev) {return this.selected().setTeXclass(prev)}, setTeXclass: function (prev) {return this.selected().setTeXclass(prev)},