diff options
Diffstat (limited to 'options')
| -rw-r--r-- | options/options.coffee | 13 | ||||
| -rw-r--r-- | options/options.html | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/options/options.coffee b/options/options.coffee index 6dc2c8dd..abe3fee7 100644 --- a/options/options.coffee +++ b/options/options.coffee @@ -56,11 +56,14 @@ saveOptions = -> # the freedom to change the defaults in the future. for fieldName in editableFields field = $(fieldName) - if field.getAttribute("type") is "checkbox" - fieldValue = field.checked - else - fieldValue = field.value.trim() - field.value = fieldValue + switch field.getAttribute("type") + when "checkbox" + fieldValue = field.checked + when "number" + fieldValue = parseFloat field.value + else + fieldValue = field.value.trim() + field.value = fieldValue # If it's empty and not a field that we allow to be empty, restore to the default value if not fieldValue and canBeEmptyFields.indexOf(fieldName) is -1 diff --git a/options/options.html b/options/options.html index d5f836e7..f6059618 100644 --- a/options/options.html +++ b/options/options.html @@ -188,7 +188,7 @@ <tr> <td class="caption">Scroll step size</td> <td> - <input id="scrollStepSize" type="text" />px + <input id="scrollStepSize" type="number" />px </td> </tr> <tr> |
