slider: prevent issues with decimal keys
This commit is contained in:
parent
fe9e988d3e
commit
1070ccb812
2 changed files with 3 additions and 2 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
- bug fixes
|
||||
- keyboard widget: `linkId` not working (unable to link 2 keyboard widgets)
|
||||
- slides: issues with ranges containing decimal keys
|
||||
|
||||
- launcher
|
||||
- add menu options to show the qr code again
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ class Slider extends Canvas {
|
|||
this.rangeKeys = Object.keys(this.getProp('range')).sort((a,b)=>{
|
||||
if (a === 'min' || b === 'max') return -1
|
||||
else if (a === 'max' || b === 'min') return 1
|
||||
else return parseInt(a) - parseInt(b)
|
||||
else return parseFloat(a) - parseFloat(b)
|
||||
})
|
||||
this.rangeVals = []
|
||||
this.rangeLabels = []
|
||||
|
||||
for (var i in this.rangeKeys) {
|
||||
var k = this.rangeKeys[i],
|
||||
key = k == 'min' ? 0 : k == 'max' ? 100 : parseInt(k),
|
||||
key = k == 'min' ? 0 : k == 'max' ? 100 : parseFloat(k),
|
||||
val = typeof this.getProp('range')[k] === 'object' && this.getProp('range')[k] !== null ?
|
||||
this.getProp('range')[k][Object.keys(this.getProp('range')[k])[0]]:
|
||||
this.getProp('range')[k]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue