aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/settings.js30
1 files changed, 5 insertions, 25 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 05a0604a..f2250911 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -171,36 +171,16 @@ function formSetupEventListeners() {
}
function formUpdateVisibility(options) {
- const general = $('#anki-general');
- if (options.anki.enable) {
- general.show();
- } else {
- general.hide();
- }
-
- const advanced = $('.options-advanced');
- if (options.general.showAdvanced) {
- advanced.show();
- } else {
- advanced.hide();
- }
+ document.documentElement.dataset.optionsAnkiEnable = `${!!options.anki.enable}`;
+ document.documentElement.dataset.optionsGeneralDebugInfo = `${!!options.general.debugInfo}`;
+ document.documentElement.dataset.optionsGeneralShowAdvanced = `${!!options.general.showAdvanced}`;
+ document.documentElement.dataset.optionsGeneralResultOutputMode = `${options.general.resultOutputMode}`;
- const mainGroup = $('#dict-main-group');
- if (options.general.resultOutputMode === 'merge') {
- mainGroup.show();
- } else {
- mainGroup.hide();
- }
-
- const debug = $('#debug');
if (options.general.debugInfo) {
const temp = utilIsolate(options);
temp.anki.fieldTemplates = '...';
const text = JSON.stringify(temp, null, 4);
- debug.html(handlebarsEscape(text));
- debug.show();
- } else {
- debug.hide();
+ $('#debug').text(text);
}
}