summaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-07 22:16:00 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-07 22:16:00 -0800
commitf2f7b7f3dbf609619fc7de86df53ceec4c931351 (patch)
tree43664e1d4014ccaa4a35acf75fd4350777e97ebc /ext/bg/js/options-form.js
parent638fe54c2a947347c304b39421c8ea8e0503f274 (diff)
Tweaks
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js7
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);
});