diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-09-08 10:53:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-08 10:53:41 -0400 |
commit | 36fc5abae543840484b3d8f7abff85f57de66ada (patch) | |
tree | d8ce5b59ca26e8b91957989a775cb75a76c3d44a /ext/bg/js/settings/main.js | |
parent | 0a5e832dfddcc6184410e8836cc8dea030457486 (diff) |
Modifier key refactor (#784)
* Add functions for getting keyboard key information
* Use os + DocumentUtil to get modifier key names
* Remove keyboard modifier info from environment info
Diffstat (limited to 'ext/bg/js/settings/main.js')
-rw-r--r-- | ext/bg/js/settings/main.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index b29744ac..f775cd57 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -22,6 +22,7 @@ * ClipboardPopupsController * DictionaryController * DictionaryImportController + * DocumentUtil * GenericSettingController * PopupPreviewController * ProfileController @@ -43,12 +44,12 @@ async function settingsPopulateModifierKeys() { const scanModifierKeySelect = document.querySelector('#scan-modifier-key'); scanModifierKeySelect.textContent = ''; - const environment = await api.getEnvironmentInfo(); + const {platform: {os}} = await api.getEnvironmentInfo(); const modifierKeys = [ - {value: 'none', name: 'None'}, - ...environment.modifiers.keys + ['none', 'None'], + DocumentUtil.getModifierKeys(os) ]; - for (const {value, name} of modifierKeys) { + for (const [value, name] of modifierKeys) { const option = document.createElement('option'); option.value = value; option.textContent = name; |