Skip to content
Browse files

Ensure CSS is applied before positioning graphie labels

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D118
  • Loading branch information...
1 parent 97bf55b commit 805fee66770c4bed970a7a11e5666ae294807959 @beneater beneater committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 utils/graphie.js
View
12 utils/graphie.js
@@ -259,23 +259,23 @@
if (latex) {
var code = $("<code>").text(text);
span = $("<span>").append(code);
- // Add to the MathJax queue
- if (typeof MathJax !== "undefined") {
- $.tmpl.type.code()(code[0]);
- }
} else {
span = $("<span>").html(text);
}
var pad = currentStyle["label-distance"];
- span.css({
+ span.css($.extend({}, currentStyle, {
position: "absolute",
left: scaled[0],
top: scaled[1],
padding: (pad != null ? pad : 7) + "px"
- }).appendTo(el);
+ })).appendTo(el);
if (typeof MathJax !== "undefined") {
+ // Add to the MathJax queue
+ if (latex) {
+ $.tmpl.type.code()(code[0]);
+ }
// Run after MathJax typesetting
MathJax.Hub.Queue(function() {
// Avoid an icky flash

0 comments on commit 805fee6

Please sign in to comment.
Something went wrong with that request. Please try again.