mirror of
https://github.com/atom/atom.git
synced 2026-02-05 20:25:04 -05:00
Support setting number fields to 0
Previously entering 0 would end up as '0' in the config value instead of as a numeric value.
This commit is contained in:
@@ -32,8 +32,12 @@ class ConfigPanel extends View
|
||||
|
||||
parseValue: (type, value) ->
|
||||
switch type
|
||||
when 'int' then value = parseInt(value) or value
|
||||
when 'float' then value = parseFloat(value) or value
|
||||
when 'int'
|
||||
intValue = parseInt(value)
|
||||
value = intValue unless isNaN(intValue)
|
||||
when 'float'
|
||||
floatValue = parseFloat(value)
|
||||
value = floatValue unless isNaN(floatValue)
|
||||
value = undefined if value == ''
|
||||
value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user