aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-27 09:01:12 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-27 09:01:12 -0800
commit3fa393354b90cee5a349ab813889fe2d8cd59289 (patch)
tree81078a70922e83e040cfad7a42774cbf3e447bb0 /ext/bg/js
parent0e0a0a3e51a3812a9ccdb64216c70770881b9082 (diff)
store max number of results to display
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js6
-rw-r--r--ext/bg/js/options.js3
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index eafb3e09..92596773 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -30,9 +30,10 @@ function getFormData() {
optionsNew.general.autoStart = $('#activate-on-startup').prop('checked');
optionsNew.general.audioPlayback = $('#audio-playback-buttons').prop('checked');
- optionsNew.general.softKatakana = $('#soft-katakana-search').prop('checked');
optionsNew.general.groupResults = $('#group-terms-results').prop('checked');
+ optionsNew.general.softKatakana = $('#soft-katakana-search').prop('checked');
optionsNew.general.showAdvanced = $('#show-advanced-options').prop('checked');
+ optionsNew.general.maxResults = parseInt($('#max-displayed-results').val(), 10);
optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked');
optionsNew.scanning.selectText = $('#select-matched-text').prop('checked');
@@ -86,9 +87,10 @@ $(document).ready(() => {
optionsLoad().then(options => {
$('#activate-on-startup').prop('checked', options.general.autoStart);
$('#audio-playback-buttons').prop('checked', options.general.audioPlayback);
- $('#soft-katakana-search').prop('checked', options.general.softKatakana);
$('#group-terms-results').prop('checked', options.general.groupResults);
+ $('#soft-katakana-search').prop('checked', options.general.softKatakana);
$('#show-advanced-options').prop('checked', options.general.showAdvanced);
+ $('#max-displayed-results').val(options.general.maxResults);
$('#hold-shift-to-scan').prop('checked', options.scanning.requireShift);
$('#select-matched-text').prop('checked', options.scanning.selectText);
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index dcf9d075..066ed62c 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -22,8 +22,9 @@ function optionsSetDefaults(options) {
general: {
autoStart: true,
audioPlayback: true,
- softKatakana: true,
groupResults: true,
+ softKatakana: true,
+ maxResults: 32,
showAdvanced: false
},