diff options
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/options-form.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js index b9ca1e0a..f5ca3ce2 100644 --- a/ext/bg/js/options-form.js +++ b/ext/bg/js/options-form.js @@ -153,6 +153,9 @@ function onDictionaryDelete() { const dictDelete = $(this); dictDelete.prop('disabled', true); + const dictError = $('#dict-error'); + dictError.hide(); + const dictGroup = dictDelete.closest('.dict-group'); database().deleteDictionary(dictGroup.data('title')).then(() => { dictGroup.slideUp(); @@ -176,11 +179,13 @@ function onDictionaryImport() { progressbar.find('div').css('width', `${current / total * 100.0}%`); }; - database().importDictionary($('#dict-url').val(), callback).then(() => { + const dictUrl = $('#dict-url'); + database().importDictionary(dictUrl.val(), callback).then(() => { return loadOptions().then(opts => populateDictionaries(opts)); }).catch(error => { dictError.show().find('span').text(error); }).then(() => { + dictUrl.val(''); progressbar.hide(); dictImport.prop('disabled', false); }); |