mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
reversing order of arguments, as text may already exist
This commit is contained in:
parent
00fc31b0a8
commit
57f05c4a2b
@ -390,11 +390,15 @@ define(["widgets/js/manager",
|
||||
}
|
||||
},
|
||||
|
||||
typeset: function(text, $el){
|
||||
// check if MathJax is available, and if so use it to
|
||||
// typeset some jQuery selection
|
||||
$el.text(text);
|
||||
if(!window.MathJax){ return; }
|
||||
typeset: function($el, text){
|
||||
// after (optionally) updating a selection's text, check if
|
||||
// MathJax is available and typeset it
|
||||
if(arguments.length > 1){
|
||||
$el.text(text);
|
||||
}
|
||||
if(!window.MathJax){
|
||||
return;
|
||||
}
|
||||
return MathJax.Hub.Queue(["Typeset", MathJax.Hub, $el.get(0)]);
|
||||
}
|
||||
});
|
||||
|
@ -62,7 +62,7 @@ define([
|
||||
if (description.trim().length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ define([
|
||||
if (description.trim().length === 0) {
|
||||
this.$title.html(" "); // Preserve title height
|
||||
} else {
|
||||
this.typeset(description, this.$title);
|
||||
this.typeset(this.$title, description);
|
||||
}
|
||||
|
||||
var button_text = this.model.get('button_text');
|
||||
|
@ -155,7 +155,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
@ -441,7 +441,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
return ProgressView.__super__.update.apply(this);
|
||||
|
@ -97,7 +97,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
@ -230,7 +230,7 @@ define([
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.$label.text(description);
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
@ -345,7 +345,7 @@ define([
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.$label.text();
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
@ -467,7 +467,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +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.typeset(this.model.get('value'), this.$el);
|
||||
this.typeset(this.$el, this.model.get('value'));
|
||||
return LatexView.__super__.update.apply(this);
|
||||
},
|
||||
});
|
||||
@ -114,7 +114,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
@ -197,7 +197,7 @@ define([
|
||||
if (description.length === 0) {
|
||||
this.$label.hide();
|
||||
} else {
|
||||
this.typeset(description, this.$label);
|
||||
this.typeset(this.$label, description);
|
||||
this.$label.show();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user