Commit 5d708696 authored by David Schnur's avatar David Schnur

Simplify creation of the cached element.

parent ff0e5c1b
...@@ -286,25 +286,18 @@ Licensed under the MIT license. ...@@ -286,25 +286,18 @@ Licensed under the MIT license.
if (info == null) { if (info == null) {
var element = $("<div>" + text + "</div>"); var element = $("<div></div>").html(text).css({
position: "absolute",
top: -9999
});
if (typeof font === "object") { if (typeof font === "object") {
element.css({ element.css({
font: textStyle, font: textStyle,
color: font.color, color: font.color,
position: "absolute",
top: -9999
}); });
} else if (typeof font === "string") { } else if (typeof font === "string") {
element.addClass(font).css({ element.addClass(font);
position: "absolute",
top: -9999
});
} else {
element.css({
position: "absolute",
top: -9999
});
} }
element.appendTo(this.container); element.appendTo(this.container);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment