also setting text in widget.typset

Nicholas Bollweg (Nick) 11 years ago
parent 9cd878cf0f
commit 00fc31b0a8

@ -390,15 +390,12 @@ define(["widgets/js/manager",
}
},
typeset: function(element){
typeset: function(text, $el){
// check if MathJax is available, and if so use it to
// typeset some DOM
// typeset some jQuery selection
$el.text(text);
if(!window.MathJax){ return; }
return MathJax.Hub.Queue([
"Typeset",
MathJax.Hub,
element
]);
return MathJax.Hub.Queue(["Typeset", MathJax.Hub, $el.get(0)]);
}
});

@ -62,8 +62,7 @@ define([
if (description.trim().length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}

@ -319,8 +319,7 @@ define([
if (description.trim().length === 0) {
this.$title.html(" "); // Preserve title height
} else {
this.$title.text(description);
this.typeset(this.$title.get(0));
this.typeset(description, this.$title);
}
var button_text = this.model.get('button_text');

@ -155,8 +155,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
@ -323,8 +322,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}
@ -443,8 +441,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
return ProgressView.__super__.update.apply(this);

@ -97,8 +97,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}
@ -231,7 +230,7 @@ define([
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}
@ -345,8 +344,8 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.$label.text();
this.typeset(description, this.$label);
this.$label.show();
}
}
@ -468,8 +467,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}

@ -43,8 +43,7 @@ define([
* Called when the model is changed. The model may have been
* changed by another view or by a state update from the back-end.
*/
this.$el.text(this.model.get('value'));
this.typeset(this.$el.get(0));
this.typeset(this.model.get('value'), this.$el);
return LatexView.__super__.update.apply(this);
},
});
@ -115,8 +114,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}
@ -199,8 +197,7 @@ define([
if (description.length === 0) {
this.$label.hide();
} else {
this.$label.text(description);
this.typeset(this.$label.get(0));
this.typeset(description, this.$label);
this.$label.show();
}
}

Loading…
Cancel
Save