Don't redraw if the placeholder loses its dimensions

git-svn-id: https://flot.googlecode.com/svn/trunk@270 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 16 years ago
parent dd36a2a963
commit e4aaacc6b3

@ -32,8 +32,15 @@ plots, you can just fix the size of their placeholders.
plot.getPlaceholder().resize(onResize);
function onResize() {
var placeholder = plot.getPlaceholder();
// somebody might have hidden us and we can't plot
// when we don't have the dimensions
if (placeholder.width() == 0 || placeholder.height() == 0)
return;
++redrawing;
$.plot(plot.getPlaceholder(), plot.getData(), plot.getOptions());
$.plot(placeholder, plot.getData(), plot.getOptions());
--redrawing;
}
}

Loading…
Cancel
Save