aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-26 17:14:50 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-26 17:14:50 -0700
commit5de3005d0b9ce8dc30e6e1d8d869c57876ca136f (patch)
tree2465b5d1663e9c9497926e0d0abecf3c729d88bd /ext/bg/js/util.js
parentfefadf78085d251a6b5f1c3ca081f10a5ffc4012 (diff)
show "off" on button when extension is disabled
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 6999cae3..bde174c8 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -256,7 +256,7 @@ function optionsSave(options) {
* Dictionary
*/
-function dictEnabled(options) {
+function dictEnabledSet(options) {
const dictionaries = {};
for (const title in options.dictionaries) {
const dictionary = options.dictionaries[title];
@@ -268,6 +268,16 @@ function dictEnabled(options) {
return dictionaries;
}
+function dictConfigured(options) {
+ for (const title in options.dictionaries) {
+ if (options.dictionaries[title].enabled) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
function dictRowsSort(rows, options) {
return rows.sort((ra, rb) => {
const pa = (options.dictionaries[ra.title] || {}).priority || 0;