diff options
author | Klemen Košir <klemen.kosir@kream.io> | 2018-10-02 23:27:59 +0900 |
---|---|---|
committer | Klemen Košir <klemen.kosir@kream.io> | 2018-10-02 23:27:59 +0900 |
commit | 99a231a7738c712090a3ca3a088e3a1b22af5fea (patch) | |
tree | 332c335dd845d53db49a3740ed548d615445776c /ext/bg | |
parent | 39cf302eefe1b3bc19e4a91c222872b322426354 (diff) |
Add horizontal popup offset
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/options.js | 3 | ||||
-rw-r--r-- | ext/bg/js/settings.js | 6 | ||||
-rw-r--r-- | ext/bg/settings.html | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 373a1a6b..b5e1a27d 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -192,7 +192,8 @@ function optionsSetDefaults(options) { showAdvanced: false, popupWidth: 400, popupHeight: 250, - popupOffset: 10, + popupHorizontalOffset: 0, + popupVerticalOffset: 10, showGuide: true, compactTags: false, compactGlossaries: false, diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index 7bc6a651..b5c733e2 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -33,7 +33,8 @@ async function formRead() { 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.general.popupHorizontalOffset = parseInt($('#popup-horizontal-offset').val(), 0); + optionsNew.general.popupVerticalOffset = parseInt($('#popup-vertical-offset').val(), 10); optionsNew.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked'); optionsNew.scanning.selectText = $('#select-matched-text').prop('checked'); @@ -163,7 +164,8 @@ async function onReady() { $('#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); + $('#popup-horizontal-offset').val(options.general.popupHorizontalOffset); + $('#popup-vertical-offset').val(options.general.popupVerticalOffset); $('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse); $('#select-matched-text').prop('checked', options.scanning.selectText); diff --git a/ext/bg/settings.html b/ext/bg/settings.html index c77f550c..5570b82f 100644 --- a/ext/bg/settings.html +++ b/ext/bg/settings.html @@ -93,8 +93,11 @@ </div> <div class="form-group options-advanced"> - <label for="popup-offset">Popup offset (in pixels)</label> - <input type="number" min="0" id="popup-offset" class="form-control"> + <label>Popup offset (horizontal, vertical; in pixels)</label> + <div class="row"> + <div class="col-xs-6"><input type="number" min="0" id="popup-horizontal-offset" class="form-control"></div> + <div class="col-xs-6"><input type="number" min="0" id="popup-vertical-offset" class="form-control"></div> + </div> </div> </div> |