From 6e6d23681954e004977f9664734358d5bb32501c Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 22 Feb 2023 19:56:45 +0530 Subject: [PATCH] Change the image zoom size if the textbox is edited next to the slider --- ui/media/js/main.js | 2 +- ui/media/js/parameters.js | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index a95aebd8..8dc6f14c 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -1332,7 +1332,7 @@ outputFormatField.addEventListener('change', e => { } }) /********************* Zoom Slider **********************/ -thumbnailSizeField.addEventListener('input', () => { +thumbnailSizeField.addEventListener('change', () => { (function (s) { for (var j =0; j < document.styleSheets.length; j++) { let cssSheet = document.styleSheets[j] diff --git a/ui/media/js/parameters.js b/ui/media/js/parameters.js index a83b2844..0e4b9b22 100644 --- a/ui/media/js/parameters.js +++ b/ui/media/js/parameters.js @@ -156,17 +156,6 @@ var PARAMETERS = [ icon: "fa-gear", default: true, }, - /* { - id: "thumbnail_size", - type: ParameterType.slider, - label: "Maximum image display size", - note: "Downscale large images to keep a better overview", - icon: "fa-compress", - slider_min: 1, - slider_max: 100, - slider_unit: "%", - default: 70 - }, */ { id: "confirm_dangerous_actions", type: ParameterType.checkbox, @@ -213,11 +202,13 @@ function getParameterSettingsEntry(id) { function sliderUpdate(event) { if (event.srcElement.id.endsWith('-input')) { - console.log(event.srcElement.value) - document.getElementById(event.srcElement.id.slice(0,-6)).value = event.srcElement.value + let slider = document.getElementById(event.srcElement.id.slice(0,-6)) + slider.value = event.srcElement.value + slider.dispatchEvent(new Event("change")) } else { - console.log(event.srcElement.value) - document.getElementById(event.srcElement.id+'-input').value = event.srcElement.value + let field = document.getElementById(event.srcElement.id+'-input') + field.value = event.srcElement.value + field.dispatchEvent(new Event("change")) } }