Fix graph resize bug when no graph exists.

This commit is contained in:
Julius Volz 2013-07-24 02:20:42 +02:00
parent 9f07f8677a
commit c91c100102

View file

@ -482,10 +482,12 @@ Prometheus.Graph.prototype.updateGraph = function(reloadGraph) {
Prometheus.Graph.prototype.resizeGraph = function() { Prometheus.Graph.prototype.resizeGraph = function() {
var self = this; var self = this;
self.rickshawGraph.configure({ if (self.rickshawGraph != null) {
width: Math.max(self.graph.innerWidth() - 80, 200), self.rickshawGraph.configure({
}); width: Math.max(self.graph.innerWidth() - 80, 200),
self.rickshawGraph.render(); });
self.rickshawGraph.render();
}
} }
Prometheus.Graph.prototype.handleGraphResponse = function(json, textStatus) { Prometheus.Graph.prototype.handleGraphResponse = function(json, textStatus) {