summaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-10 19:36:45 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-10 19:36:45 -0800
commit0ff41d5843b3bf39994ae32e4ab623bfe0e4e3ca (patch)
treeb1eb44335b0004c9e5243db8db5ed90b4a52a942 /ext/bg/js/options-form.js
parent8b5ee629311065bc53537d5684931dbf775c4e3e (diff)
Delete dictionary deletion
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js33
1 files changed, 1 insertions, 32 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 1f64f8d0..501848ad 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -141,7 +141,6 @@ function populateDictionaries(opts) {
});
$('.dict-enable-terms, .dict-enable.kanji').change(onOptionsChanged);
- $('.dict-delete').click(onDictionaryDelete);
}).catch(error => {
dictError.show().find('span').text(error);
}).then(() => {
@@ -149,36 +148,6 @@ function populateDictionaries(opts) {
});
}
-function onDictionaryDelete() {
- const dictGroup = $(this).closest('.dict-group');
-
- const dictError = $('#dict-error');
- dictError.hide();
-
- const dictSpinner = $('#dict-spinner');
- dictSpinner.show();
-
- const dictProgress = dictGroup.find('.dict-delete-progress');
- dictProgress.show();
-
- const dictControls = dictGroup.find('.dict-controls');
- dictControls.hide();
-
- const callback = (total, current) => {
- dictProgress.find('div').css('width', `${current / total * 100.0}%`);
- };
-
- database().deleteDictionary(dictGroup.data('title'), callback).then(() => {
- dictGroup.slideUp();
- }).catch(error => {
- dictError.show().find('span').text(error);
- }).then(() => {
- dictSpinner.hide();
- dictProgress.hide();
- dictControls.show();
- });
-}
-
function onDictionaryImport() {
const dictImport = $(this);
dictImport.prop('disabled', true);
@@ -186,7 +155,7 @@ function onDictionaryImport() {
const dictError = $('#dict-error');
dictError.hide();
- const dictProgress = $('.dict-import-progress');
+ const dictProgress = $('.dict-progress');
dictProgress.show();
const dictSpinner = $('#dict-spinner');