diff options
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r-- | ext/bg/js/options-form.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js index adde147c..a495813d 100644 --- a/ext/bg/js/options-form.js +++ b/ext/bg/js/options-form.js @@ -19,18 +19,20 @@ function optionsToForm(opts) { $('#scanLength').val(opts.scanLength); + $('#loadOnStartup').prop('checked', opts.loadOnStartup); } function formToOptions() { return sanitizeOptions({ - scanLength: $('#scanLength').val() + scanLength: $('#scanLength').val(), + loadOnStartup: $('#loadOnStartup').prop('checked') }); } $('#saveOptions').click(() => { - const opt = formToOptions(); + const opts = formToOptions(); const yomichan = chrome.extension.getBackgroundPage().yomichan; - saveOptions(() => yomichan.updateOptions(opts)); + saveOptions(opts, () => yomichan.updateOptions(opts)); }); $('#resetOptions').click(() => { |