Commit 98b6361a authored by David Schnur's avatar David Schnur

Preserve canvas elements on re-plot.

Since the Canvas .text object is jQuery-wrapped, it was not preserved as
expected when clearing the canvas of junk.  I've replaced the selection
with one based on element classes.
parent d2642e80
......@@ -189,13 +189,15 @@ Licensed under the MIT license.
// Add the HTML text layer, if it doesn't already exist
if (!this.text) {
this.text = $("<div></div>").css({
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
}).insertAfter(this.element);
this.text = $("<div></div>")
.addClass("flot-text")
.css({
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
}).insertAfter(this.element);
}
this.text.append(this._textBuffer);
......@@ -1122,7 +1124,7 @@ Licensed under the MIT license.
// then whack any remaining obvious garbage left
eventHolder.unbind();
placeholder.children().not([surface.element, surface.text, overlay.element, overlay.text]).remove();
placeholder.children(":not(.flot-base,.flot-overlay,.flot-text)").remove();
}
// save in case we get replotted
......
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