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/profile-conditions-ui.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/profile-conditions-ui.js')
-rw-r--r-- | ext/bg/js/settings/profile-conditions-ui.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/bg/js/settings/profile-conditions-ui.js b/ext/bg/js/settings/profile-conditions-ui.js index 4fb181cf..d88f932b 100644 --- a/ext/bg/js/settings/profile-conditions-ui.js +++ b/ext/bg/js/settings/profile-conditions-ui.js @@ -22,8 +22,7 @@ class ProfileConditionsUI { constructor(settingsController) { this._settingsController = settingsController; - this._keySeparator = ''; - this._keyNames = new Map(); + this._os = null; this._conditionGroupsContainer = null; this._addConditionGroupButton = null; this._children = []; @@ -80,12 +79,12 @@ class ProfileConditionsUI { return this._settingsController.profileIndex; } - setKeyInfo(separator, keyNames) { - this._keySeparator = separator; - this._keyNames.clear(); - for (const {value, name} of keyNames) { - this._keyNames.set(value, name); - } + get os() { + return this._os; + } + + set os(value) { + this._os = value; } prepare(conditionGroups) { @@ -209,7 +208,7 @@ class ProfileConditionsUI { } createKeyboardMouseInputField(inputNode, mouseButton) { - return new KeyboardMouseInputField(inputNode, mouseButton, this._keyNames, this._keySeparator); + return new KeyboardMouseInputField(inputNode, mouseButton, this._os); } // Private |