From 83e2fd47485f7036c387563277db06aec14aa462 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 11 Mar 2017 17:48:30 -0800 Subject: add options for setting popup width, height, offset --- ext/bg/js/options.js | 6 ++++++ ext/bg/js/util.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'ext/bg/js') diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 3b10b74f..a094f73f 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -30,6 +30,9 @@ function formRead() { 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.general.popupWidth = parseInt($('#popup-width').val(), 10); + optionsNew.general.popupHeight = parseInt($('#popup-height').val(), 10); + optionsNew.general.popupOffset = parseInt($('#popup-offset').val(), 10); optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked'); optionsNew.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked'); @@ -112,6 +115,9 @@ $(document).ready(() => { $('#soft-katakana-search').prop('checked', options.general.softKatakana); $('#show-advanced-options').prop('checked', options.general.showAdvanced); $('#max-displayed-results').val(options.general.maxResults); + $('#popup-width').val(options.general.popupWidth); + $('#popup-height').val(options.general.popupHeight); + $('#popup-offset').val(options.general.popupOffset); $('#hold-shift-to-scan').prop('checked', options.scanning.requireShift); $('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse); diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 7f031040..f9b221b3 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -79,7 +79,10 @@ function optionsSetDefaults(options) { groupResults: true, softKatakana: true, maxResults: 32, - showAdvanced: false + showAdvanced: false, + popupWidth: 400, + popupHeight: 250, + popupOffset: 10 }, scanning: { -- cgit v1.2.3