mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 13:26:34 +00:00
Fix safari not rendering history graph (#7025)
This commit is contained in:
parent
9b25a54a47
commit
a8a1563586
@ -62,12 +62,22 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
this.drawChart();
|
this.drawChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ready() {
|
||||||
|
super.ready();
|
||||||
|
// safari doesn't always render the canvas when we animate it, so we remove overflow hidden when the animation is complete
|
||||||
|
this.addEventListener("transitionend", () => {
|
||||||
|
this.style.overflow = "auto";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
dataChanged() {
|
dataChanged() {
|
||||||
this.drawChart();
|
this.drawChart();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRenderedChanged(rendered) {
|
_onRenderedChanged(rendered) {
|
||||||
if (rendered) this.animateHeight();
|
if (rendered) {
|
||||||
|
this.animateHeight();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateHeight() {
|
animateHeight() {
|
||||||
@ -79,15 +89,15 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawChart() {
|
drawChart() {
|
||||||
|
if (!this._isAttached) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const unit = this.unit;
|
const unit = this.unit;
|
||||||
const deviceStates = this.data;
|
const deviceStates = this.data;
|
||||||
const datasets = [];
|
const datasets = [];
|
||||||
let endTime;
|
let endTime;
|
||||||
|
|
||||||
if (!this._isAttached) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deviceStates.length === 0) {
|
if (deviceStates.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user