aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-08 20:34:28 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-08 20:34:28 -0800
commit5bbf9aa07b2142550b73aff20713cbaa430b2433 (patch)
treef612e63a2f5a197e37a9401d7195f2cbdee73ba3 /ext/bg/js/options-form.js
parent885f508edafdcf7f060dde73b6bae65f56bed3d2 (diff)
WIP
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 8bb60808..8e117012 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -122,8 +122,8 @@ function populateDictionaries(opts) {
const dictError = $('#dict-error');
dictError.hide();
- const dictLaggy = $('#dict-laggy');
- dictLaggy.show();
+ const dictSpinner = $('#dict-spinner');
+ dictSpinner.show();
database().getDictionaries().then(rows => {
rows.forEach(row => {
@@ -145,7 +145,7 @@ function populateDictionaries(opts) {
}).catch(error => {
dictError.show().find('span').text(error);
}).then(() => {
- dictLaggy.hide();
+ dictSpinner.hide();
});
}
@@ -156,12 +156,17 @@ function onDictionaryDelete() {
const dictError = $('#dict-error');
dictError.hide();
+ const dictSpinner = $('#dict-spinner');
+ dictSpinner.show();
+
const dictGroup = dictDelete.closest('.dict-group');
database().deleteDictionary(dictGroup.data('title')).then(() => {
dictGroup.slideUp();
}).catch(error => {
dictError.show().find('span').text(error);
dictDelete.prop('disabled', false);
+ }).then(() => {
+ dictSpinner.hide();
});
}
@@ -172,6 +177,9 @@ function onDictionaryImport() {
const dictError = $('#dict-error');
dictError.hide();
+ const dictSpinner = $('#dict-spinner');
+ dictSpinner.show();
+
const progressbar = $('#dict-import-progress');
progressbar.show();
@@ -185,9 +193,10 @@ function onDictionaryImport() {
}).catch(error => {
dictError.show().find('span').text(error);
}).then(() => {
+ dictImport.prop('disabled', false);
dictUrl.val('');
progressbar.hide();
- dictImport.prop('disabled', false);
+ dictSpinner.hide();
});
}