##// END OF EJS Templates
reversing order of arguments, as text may already exist
Nicholas Bollweg (Nick) -
Show More
@@ -390,11 +390,15 b' define(["widgets/js/manager",'
390 390 }
391 391 },
392 392
393 typeset: function(text, $el){
394 // check if MathJax is available, and if so use it to
395 // typeset some jQuery selection
396 $el.text(text);
397 if(!window.MathJax){ return; }
393 typeset: function($el, text){
394 // after (optionally) updating a selection's text, check if
395 // MathJax is available and typeset it
396 if(arguments.length > 1){
397 $el.text(text);
398 }
399 if(!window.MathJax){
400 return;
401 }
398 402 return MathJax.Hub.Queue(["Typeset", MathJax.Hub, $el.get(0)]);
399 403 }
400 404 });
@@ -62,7 +62,7 b' define(['
62 62 if (description.trim().length === 0) {
63 63 this.$label.hide();
64 64 } else {
65 this.typeset(description, this.$label);
65 this.typeset(this.$label, description);
66 66 this.$label.show();
67 67 }
68 68 }
@@ -319,7 +319,7 b' define(['
319 319 if (description.trim().length === 0) {
320 320 this.$title.html(" "); // Preserve title height
321 321 } else {
322 this.typeset(description, this.$title);
322 this.typeset(this.$title, description);
323 323 }
324 324
325 325 var button_text = this.model.get('button_text');
@@ -155,7 +155,7 b' define(['
155 155 if (description.length === 0) {
156 156 this.$label.hide();
157 157 } else {
158 this.typeset(description, this.$label);
158 this.typeset(this.$label, description);
159 159 this.$label.show();
160 160 }
161 161
@@ -322,7 +322,7 b' define(['
322 322 if (description.length === 0) {
323 323 this.$label.hide();
324 324 } else {
325 this.typeset(description, this.$label);
325 this.typeset(this.$label, description);
326 326 this.$label.show();
327 327 }
328 328 }
@@ -441,7 +441,7 b' define(['
441 441 if (description.length === 0) {
442 442 this.$label.hide();
443 443 } else {
444 this.typeset(description, this.$label);
444 this.typeset(this.$label, description);
445 445 this.$label.show();
446 446 }
447 447 return ProgressView.__super__.update.apply(this);
@@ -97,7 +97,7 b' define(['
97 97 if (description.length === 0) {
98 98 this.$label.hide();
99 99 } else {
100 this.typeset(description, this.$label);
100 this.typeset(this.$label, description);
101 101 this.$label.show();
102 102 }
103 103 }
@@ -230,7 +230,7 b' define(['
230 230 this.$label.hide();
231 231 } else {
232 232 this.$label.text(description);
233 this.typeset(description, this.$label);
233 this.typeset(this.$label, description);
234 234 this.$label.show();
235 235 }
236 236 }
@@ -345,7 +345,7 b' define(['
345 345 this.$label.hide();
346 346 } else {
347 347 this.$label.text();
348 this.typeset(description, this.$label);
348 this.typeset(this.$label, description);
349 349 this.$label.show();
350 350 }
351 351 }
@@ -467,7 +467,7 b' define(['
467 467 if (description.length === 0) {
468 468 this.$label.hide();
469 469 } else {
470 this.typeset(description, this.$label);
470 this.typeset(this.$label, description);
471 471 this.$label.show();
472 472 }
473 473 }
@@ -43,7 +43,7 b' define(['
43 43 * Called when the model is changed. The model may have been
44 44 * changed by another view or by a state update from the back-end.
45 45 */
46 this.typeset(this.model.get('value'), this.$el);
46 this.typeset(this.$el, this.model.get('value'));
47 47 return LatexView.__super__.update.apply(this);
48 48 },
49 49 });
@@ -114,7 +114,7 b' define(['
114 114 if (description.length === 0) {
115 115 this.$label.hide();
116 116 } else {
117 this.typeset(description, this.$label);
117 this.typeset(this.$label, description);
118 118 this.$label.show();
119 119 }
120 120 }
@@ -197,7 +197,7 b' define(['
197 197 if (description.length === 0) {
198 198 this.$label.hide();
199 199 } else {
200 this.typeset(description, this.$label);
200 this.typeset(this.$label, description);
201 201 this.$label.show();
202 202 }
203 203 }
General Comments 0
You need to be logged in to leave comments. Login now