fix(prefs): Minor tweaks, see description

- Make the keymaps panel less wide
- <select>'s now populate their current value properly
- Items should blur after being interacted with so that `esc` still moves you back to parent sheet
This commit is contained in:
Ben Gotow 2015-11-23 20:34:04 -08:00
parent e72d522b2b
commit 5ee8ffabbc
2 changed files with 8 additions and 2 deletions

View file

@ -34,7 +34,7 @@ class ConfigSchemaItem extends React.Component
else if @props.configSchema['enum']?
<div className="item">
<label htmlFor={@props.keyPath}>{@props.configSchema.title}:</label>
<select onChange={@_onChangeValue}>
<select onChange={@_onChangeValue} value={@props.config.get(@props.keyPath)}>
{_.zip(@props.configSchema.enum, @props.configSchema.enumLabels).map ([value, label]) =>
<option value={value}>{label}</option>
}
@ -54,10 +54,12 @@ class ConfigSchemaItem extends React.Component
return true if process.platform in @props.configSchema.platforms
return false
_onChangeChecked: =>
_onChangeChecked: (event) =>
@props.config.toggle(@props.keyPath)
event.target.blur()
_onChangeValue: (event) =>
@props.config.set(@props.keyPath, event.target.value)
event.target.blur()
module.exports = ConfigSchemaItem

View file

@ -161,6 +161,8 @@
}
.container-keymaps {
max-width: 450px;
.shortcut {
padding: 3px 0;
&.shortcut-select {
@ -184,6 +186,8 @@
}
.container-accounts {
max-width: 600px;
.account-name {
font-size: @font-size-large;
cursor:default;