summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/options-form.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 422b9b4a..53e65b6f 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -35,7 +35,16 @@ function formToOptions() {
});
}
+function updateVisibility() {
+ if ($('#enableAnkiConnect').prop('checked')) {
+ $('.options-anki').show();
+ } else {
+ $('.options-anki').hide();
+ }
+}
+
function onOptionsChanged() {
+ updateVisibility();
const opts = formToOptions();
saveOptions(opts, () => {
chrome.extension.getBackgroundPage().yomichan.setOptions(opts);
@@ -44,6 +53,7 @@ function onOptionsChanged() {
$(document).ready(() => {
loadOptions((opts) => {
+ updateVisibility();
optionsToForm(opts);
$('input').on('input paste change', onOptionsChanged);
});