Update how nodes are hidden
This commit is contained in:
parent
3d78d5400d
commit
e355b83914
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#anki-spinner, #anki-error,
|
#anki-spinner, #anki-error,
|
||||||
#dict-spinner, #dict-error, #dict-warning, #dict-purge, #dict-import-progress,
|
#dict-spinner, #dict-import-progress,
|
||||||
.storage-hidden, #storage-spinner {
|
.storage-hidden, #storage-spinner {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -270,6 +270,8 @@ async function onDatabaseUpdated(options) {
|
|||||||
const dictionaries = await utilDatabaseGetDictionaryInfo();
|
const dictionaries = await utilDatabaseGetDictionaryInfo();
|
||||||
dictionaryUI.setDictionaries(dictionaries);
|
dictionaryUI.setDictionaries(dictionaries);
|
||||||
|
|
||||||
|
document.querySelector('#dict-warning').hidden = (dictionaries.length > 0);
|
||||||
|
|
||||||
updateMainDictionarySelect(options, dictionaries);
|
updateMainDictionarySelect(options, dictionaries);
|
||||||
|
|
||||||
const {counts, total} = await utilDatabaseGetDictionaryCounts(dictionaries.map(v => v.title), true);
|
const {counts, total} = await utilDatabaseGetDictionaryCounts(dictionaries.map(v => v.title), true);
|
||||||
@ -353,8 +355,8 @@ dictionaryErrorToString.overrides = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
function dictionaryErrorsShow(errors) {
|
function dictionaryErrorsShow(errors) {
|
||||||
const dialog = $('#dict-error');
|
const dialog = document.querySelector('#dict-error');
|
||||||
dialog.show().text('');
|
dialog.textContent = '';
|
||||||
|
|
||||||
if (errors !== null && errors.length > 0) {
|
if (errors !== null && errors.length > 0) {
|
||||||
const uniqueErrors = {};
|
const uniqueErrors = {};
|
||||||
@ -375,12 +377,12 @@ function dictionaryErrorsShow(errors) {
|
|||||||
} else {
|
} else {
|
||||||
div.textContent = `${e}`;
|
div.textContent = `${e}`;
|
||||||
}
|
}
|
||||||
dialog.append($(div));
|
dialog.appendChild(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.show();
|
dialog.hidden = false;
|
||||||
} else {
|
} else {
|
||||||
dialog.hide();
|
dialog.hidden = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +412,8 @@ async function onDictionaryPurge(e) {
|
|||||||
$('#dict-purge-modal').modal('hide');
|
$('#dict-purge-modal').modal('hide');
|
||||||
|
|
||||||
const dictControls = $('#dict-importer, #dict-groups, #dict-groups-extra, #dict-main-group').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 {
|
try {
|
||||||
dictionaryErrorsShow(null);
|
dictionaryErrorsShow(null);
|
||||||
@ -432,7 +435,7 @@ async function onDictionaryPurge(e) {
|
|||||||
dictionarySpinnerShow(false);
|
dictionarySpinnerShow(false);
|
||||||
|
|
||||||
dictControls.show();
|
dictControls.show();
|
||||||
dictProgress.hide();
|
dictProgress.hidden = true;
|
||||||
|
|
||||||
if (storageEstimate.mostRecent !== null) {
|
if (storageEstimate.mostRecent !== null) {
|
||||||
storageUpdateStats();
|
storageUpdateStats();
|
||||||
|
@ -426,9 +426,9 @@
|
|||||||
<select class="form-control" id="dict-main"></select>
|
<select class="form-control" id="dict-main"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-danger" id="dict-purge">Dictionary data is being purged, please be patient...</div>
|
<div class="text-danger" id="dict-purge" hidden>Dictionary data is being purged, please be patient...</div>
|
||||||
<div class="alert alert-warning" id="dict-warning">No dictionaries have been installed</div>
|
<div class="alert alert-warning" id="dict-warning" hidden>No dictionaries have been installed</div>
|
||||||
<div class="alert alert-danger" id="dict-error"></div>
|
<div class="alert alert-danger" id="dict-error" hidden></div>
|
||||||
|
|
||||||
<div id="dict-groups"></div>
|
<div id="dict-groups"></div>
|
||||||
<div id="dict-groups-extra"></div>
|
<div id="dict-groups-extra"></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user