sliders: prevent errors for some edge-case range values
This commit is contained in:
parent
cc31377a06
commit
ac9846a1fd
2 changed files with 7 additions and 3 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
- bug fixes
|
||||
- client options: options ignored if not lowercased
|
||||
- sliders: prevent errors for some edge-case `range` values
|
||||
|
||||
## 1.9.11
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,13 @@ class Slider extends Canvas {
|
|||
|
||||
for (var k in this.getProp('range')) {
|
||||
var key = k=='min'?0:k=='max'?100:parseInt(k),
|
||||
val = typeof this.getProp('range')[k] == 'object'?
|
||||
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],
|
||||
label = typeof this.getProp('range')[k] == 'object'?
|
||||
this.getProp('range')[k]
|
||||
|
||||
if (isNaN(val) || val === null || val === undefined) val = 0
|
||||
|
||||
var label = typeof this.getProp('range')[k] === 'object' && this.getProp('range')[k] !== null ?
|
||||
Object.keys(this.getProp('range')[k])[0]:
|
||||
val
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue