Energyflow UI: first load stability (#28401)
Some checks failed
Some checks failed
This commit is contained in:
parent
8f2a6f0d0a
commit
9b7add3370
1 changed files with 16 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<div
|
<div
|
||||||
data-testid="visualization"
|
data-testid="visualization"
|
||||||
class="visualization"
|
class="visualization"
|
||||||
:class="{ 'visualization--ready': visualizationReady }"
|
:class="{ 'visualization--ready': transitionsEnabled }"
|
||||||
>
|
>
|
||||||
<div class="label-scale d-flex">
|
<div class="label-scale d-flex">
|
||||||
<div class="d-flex justify-content-start flex-grow-1">
|
<div class="d-flex justify-content-start flex-grow-1">
|
||||||
|
|
@ -140,7 +140,7 @@ export default defineComponent({
|
||||||
outPower: { type: Number, default: 0 },
|
outPower: { type: Number, default: 0 },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return { width: 0 };
|
return { width: 0, transitionsEnabled: false };
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
gridExport() {
|
gridExport() {
|
||||||
|
|
@ -189,6 +189,18 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
visualizationReady(newVal: boolean) {
|
||||||
|
if (newVal && !this.transitionsEnabled) {
|
||||||
|
// ensure screen is drawn before enabling transitions
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
this.transitionsEnabled = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
window.addEventListener("resize", this.updateElementWidth);
|
window.addEventListener("resize", this.updateElementWidth);
|
||||||
|
|
@ -321,6 +333,8 @@ html.dark .grid-import {
|
||||||
right: -0.25rem;
|
right: -0.25rem;
|
||||||
color: var(--evcc-gray);
|
color: var(--evcc-gray);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.visualization--ready .battery-hold {
|
||||||
transition-property: opacity;
|
transition-property: opacity;
|
||||||
transition-duration: var(--evcc-transition-medium);
|
transition-duration: var(--evcc-transition-medium);
|
||||||
transition-timing-function: linear;
|
transition-timing-function: linear;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue