summaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-04-06 21:02:31 -0700
committerAlex Yatskov <alex@foosoft.net>2016-04-06 21:02:31 -0700
commit03b02070b7b5ec14867c286c5aafc9f676ccea91 (patch)
treeb3d7241b9bf42e6dd62428af0381cdcbac298d2e /ext/bg/js/options-form.js
parent53b63e8ddcdfdb81990a0f406c92f2d3188e707d (diff)
Add load on startup checkbox
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js8
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(() => {