fix(flot): fixed flot issue introduced in alerting branch

This commit is contained in:
Torkel Ödegaard 2016-06-28 14:04:29 -07:00
parent 346ca3fc89
commit 9b4c0cca07
3 changed files with 10 additions and 6 deletions

View File

@ -9,4 +9,4 @@ collectd:
COLLECT_INTERVAL: 10 COLLECT_INTERVAL: 10
links: links:
- graphite - graphite
- memcached # - memcached

View File

@ -365,12 +365,20 @@ function ($, _, angular, Drop) {
plot.hooks.draw.push(function(plot) { plot.hooks.draw.push(function(plot) {
var options = plot.getOptions(); var options = plot.getOptions();
var container = plot.getPlaceholder();
var containerElem = container[0];
if (containerElem.removeEventsElements) {
container.find(".events_line").remove();
containerElem.removeEventsElements = false;
}
if (eventMarkers.eventsEnabled) { if (eventMarkers.eventsEnabled) {
// check for first run // check for first run
if (eventMarkers.getEvents().length < 1) { if (eventMarkers.getEvents().length < 1) {
eventMarkers.setTypes(options.events.types); eventMarkers.setTypes(options.events.types);
eventMarkers.setupEvents(options.events.data); eventMarkers.setupEvents(options.events.data);
containerElem.removeEventsElements = true;
} else { } else {
eventMarkers.updateEvents(); eventMarkers.updateEvents();
} }

View File

@ -1316,14 +1316,10 @@ Licensed under the MIT license.
} }
function setupCanvases() { function setupCanvases() {
// Make sure the placeholder is clear of everything except canvases // Make sure the placeholder is clear of everything except canvases
// from a previous plot in this container that we'll try to re-use. // from a previous plot in this container that we'll try to re-use.
placeholder.css("padding", 0) // padding messes up the positioning placeholder.find(".flot-text").remove();
.children().filter(function(){
return $(this).hasClass("flot-text");
}).remove();
if (placeholder.css("position") == 'static') if (placeholder.css("position") == 'static')
placeholder.css("position", "relative"); // for positioning labels and overlay placeholder.css("position", "relative"); // for positioning labels and overlay