mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Make sure colorpicker is always drawn
This commit is contained in:
parent
cac1953eb6
commit
77a2f3ace3
@ -98,12 +98,12 @@ export default new Polymer({
|
|||||||
this.context = this.canvas.getContext('2d');
|
this.context = this.canvas.getContext('2d');
|
||||||
|
|
||||||
this.debounce('drawGradient', () => {
|
this.debounce('drawGradient', () => {
|
||||||
const style = getComputedStyle(this);
|
let style;
|
||||||
const width = parseInt(style.width, 10);
|
if (!this.width || !this.height) {
|
||||||
const height = parseInt(style.height, 10);
|
style = getComputedStyle(this);
|
||||||
|
}
|
||||||
this.width = width;
|
const width = this.width || parseInt(style.width, 10);
|
||||||
this.height = height;
|
const height = this.height || parseInt(style.height, 10);
|
||||||
|
|
||||||
const colorGradient = this.context.createLinearGradient(0, 0, width, 0);
|
const colorGradient = this.context.createLinearGradient(0, 0, width, 0);
|
||||||
colorGradient.addColorStop(0, 'rgb(255,0,0)');
|
colorGradient.addColorStop(0, 'rgb(255,0,0)');
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
max-height: 0px;
|
max-height: 0px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: max-height .5s ease-in;
|
transition: max-height .2s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
.has-brightness .brightness {
|
.has-brightness .brightness {
|
||||||
@ -33,7 +33,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.has-rgb_color ha-color-picker {
|
.has-rgb_color ha-color-picker {
|
||||||
max-height: 500px;
|
max-height: 200px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
</paper-slider>
|
</paper-slider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ha-color-picker on-colorselected='colorPicked'>
|
<ha-color-picker on-colorselected='colorPicked' height='200'>
|
||||||
</ha-color-picker>
|
</ha-color-picker>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user