mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Flip x_label when it would render off-page
This commit is contained in:
parent
461e02d2b8
commit
43dc377bee
|
@ -22,6 +22,10 @@ svg {
|
|||
margin: 0 0 0 0px;
|
||||
}
|
||||
|
||||
.graph .detail .x_label.flipped {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.graph .detail .item.flipped {
|
||||
right: 10px;
|
||||
}
|
||||
|
|
|
@ -382,6 +382,14 @@ Prometheus.Graph.prototype.updateGraph = function(reloadGraph) {
|
|||
var width = this.graph.width;
|
||||
var element = jQuery(this.element);
|
||||
|
||||
jQuery(".x_label", element).each(function() {
|
||||
if ($(this).outerWidth() + element.offset().left > width) {
|
||||
$(this).addClass("flipped")
|
||||
} else {
|
||||
$(this).removeClass("flipped")
|
||||
}
|
||||
})
|
||||
|
||||
jQuery(".item", element).each(function() {
|
||||
if ($(this).outerWidth() + element.offset().left > width) {
|
||||
$(this).addClass("flipped")
|
||||
|
|
Loading…
Reference in a new issue