summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-02 14:39:37 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-07 20:30:55 -0500
commite355b839142a8bab0edc446c7da08256ad5b938c (patch)
treea8c9375df59ef559aec42ccff00ea2da9f8479e8 /ext/bg/js
parent3d78d5400d2ed6e9d8f5147f7212ec786f4f16bd (diff)
Update how nodes are hidden
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/settings-dictionaries.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/bg/js/settings-dictionaries.js b/ext/bg/js/settings-dictionaries.js
index 72a27475..2f33d1ac 100644
--- a/ext/bg/js/settings-dictionaries.js
+++ b/ext/bg/js/settings-dictionaries.js
@@ -270,6 +270,8 @@ async function onDatabaseUpdated(options) {
const dictionaries = await utilDatabaseGetDictionaryInfo();
dictionaryUI.setDictionaries(dictionaries);
+ document.querySelector('#dict-warning').hidden = (dictionaries.length > 0);
+
updateMainDictionarySelect(options, dictionaries);
const {counts, total} = await utilDatabaseGetDictionaryCounts(dictionaries.map(v => v.title), true);
@@ -353,8 +355,8 @@ dictionaryErrorToString.overrides = [
];
function dictionaryErrorsShow(errors) {
- const dialog = $('#dict-error');
- dialog.show().text('');
+ const dialog = document.querySelector('#dict-error');
+ dialog.textContent = '';
if (errors !== null && errors.length > 0) {
const uniqueErrors = {};
@@ -375,12 +377,12 @@ function dictionaryErrorsShow(errors) {
} else {
div.textContent = `${e}`;
}
- dialog.append($(div));
+ dialog.appendChild(div);
}
- dialog.show();
+ dialog.hidden = false;
} else {
- dialog.hide();
+ dialog.hidden = true;
}
}
@@ -410,7 +412,8 @@ async function onDictionaryPurge(e) {
$('#dict-purge-modal').modal('hide');
const dictControls = $('#dict-importer, #dict-groups, #dict-groups-extra, #dict-main-group').hide();
- const dictProgress = $('#dict-purge').show();
+ const dictProgress = document.querySelector('#dict-purge');
+ dictProgress.hidden = false;
try {
dictionaryErrorsShow(null);
@@ -432,7 +435,7 @@ async function onDictionaryPurge(e) {
dictionarySpinnerShow(false);
dictControls.show();
- dictProgress.hide();
+ dictProgress.hidden = true;
if (storageEstimate.mostRecent !== null) {
storageUpdateStats();