mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -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;
|
margin: 0 0 0 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.graph .detail .x_label.flipped {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.graph .detail .item.flipped {
|
.graph .detail .item.flipped {
|
||||||
right: 10px;
|
right: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,6 +382,14 @@ Prometheus.Graph.prototype.updateGraph = function(reloadGraph) {
|
||||||
var width = this.graph.width;
|
var width = this.graph.width;
|
||||||
var element = jQuery(this.element);
|
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() {
|
jQuery(".item", element).each(function() {
|
||||||
if ($(this).outerWidth() + element.offset().left > width) {
|
if ($(this).outerWidth() + element.offset().left > width) {
|
||||||
$(this).addClass("flipped")
|
$(this).addClass("flipped")
|
||||||
|
|
Loading…
Reference in a new issue