WIP
This commit is contained in:
parent
0e6c9d70f6
commit
c2532a9fd0
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user