mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Fix input_Slider pt2 (#190)
This commit is contained in:
parent
fa68419f77
commit
8d62654e4f
@ -45,9 +45,11 @@ Polymer({
|
||||
},
|
||||
min: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
value: 100,
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
@ -59,8 +61,20 @@ Polymer({
|
||||
|
||||
stateObjectChanged: function (newVal) {
|
||||
this.value = Number(newVal.state);
|
||||
this.max = Number(newVal.attributes.max);
|
||||
this.min = Number(newVal.attributes.min);
|
||||
var min = Number(newVal.attributes.min);
|
||||
var max = Number(newVal.attributes.max);
|
||||
|
||||
// Polymer doesn't batch attribute updates
|
||||
// And input_slider blows up when min > max.
|
||||
|
||||
if (max <= this.min) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
} else {
|
||||
this.max = max;
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
this.step = Number(newVal.attributes.step);
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user