summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/conditions-ui.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-05-09 18:36:00 +0300
committerGitHub <noreply@github.com>2020-05-09 18:36:00 +0300
commitd6a3825a383e13b34c03c0b36e393da52bf8cf89 (patch)
tree5bf47b68b45226a02b7d0556cee6ebbf39de9262 /ext/bg/js/settings/conditions-ui.js
parent48cf6469739b26d4157d79523ccea762ef90d6bd (diff)
Modifier key platform names (#519)
* wip * add environment class * use Environment class * use Environment for scanning modifier options * remove Environment in favor of API * await promise * use modifier symbols on macOS * fix key separator issues * if else to switch * simplify variable names
Diffstat (limited to 'ext/bg/js/settings/conditions-ui.js')
-rw-r--r--ext/bg/js/settings/conditions-ui.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/settings/conditions-ui.js b/ext/bg/js/settings/conditions-ui.js
index 0670de5a..031689a7 100644
--- a/ext/bg/js/settings/conditions-ui.js
+++ b/ext/bg/js/settings/conditions-ui.js
@@ -310,10 +310,14 @@ ConditionsUI.Condition = class Condition {
inputInner.prop('readonly', true);
let values = [];
+ let keySeparator = ' + ';
for (const object of objects) {
if (hasOwn(object, 'values')) {
values = object.values;
}
+ if (hasOwn(object, 'keySeparator')) {
+ keySeparator = object.keySeparator;
+ }
}
const pressedKeyIndices = new Set();
@@ -347,7 +351,7 @@ ConditionsUI.Condition = class Condition {
}
}
- const inputValue = [...pressedKeyIndices].map((i) => values[i].name).join(' + ');
+ const inputValue = [...pressedKeyIndices].map((i) => values[i].name).join(keySeparator);
inputInner.val(inputValue);
inputInner.change();
};