From 9ffb6c92a68983228c79819a1ccdd4dcc1fdad10 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 11 Apr 2021 17:49:37 +0100 Subject: [PATCH] reordered functions to avoid lint errors --- src/js/popups/custom-background-filter.js | 48 +++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/js/popups/custom-background-filter.js b/src/js/popups/custom-background-filter.js index e67a63f44..3f3ddf0a4 100644 --- a/src/js/popups/custom-background-filter.js +++ b/src/js/popups/custom-background-filter.js @@ -52,6 +52,30 @@ function syncSliders() { ); } +function updateNumbers() { + $(".section.customBackgroundFilter .blur .value").html( + parseFloat(filters.blur.value).toFixed(1) + ); + $(".section.customBackgroundFilter .brightness .value").html( + parseFloat(filters.brightness.value).toFixed(1) + ); + $(".section.customBackgroundFilter .saturate .value").html( + parseFloat(filters.saturate.value).toFixed(1) + ); + $(".section.customBackgroundFilter .opacity .value").html( + parseFloat(filters.opacity.value).toFixed(1) + ); +} + +export function loadConfig(config) { + filters.blur.value = config[0]; + filters.brightness.value = config[1]; + filters.saturate.value = config[2]; + filters.opacity.value = config[3]; + updateNumbers(); + syncSliders(); +} + $(".section.customBackgroundFilter .blur input").on("input", (e) => { filters["blur"].value = $( ".section.customBackgroundFilter .blur input" @@ -92,27 +116,3 @@ $(".section.customBackgroundFilter .save.button").click((e) => { UpdateConfig.setCustomBackgroundFilter(arr, false); Notifications.add("Custom background filters saved", 1); }); - -export function loadConfig(config) { - filters.blur.value = config[0]; - filters.brightness.value = config[1]; - filters.saturate.value = config[2]; - filters.opacity.value = config[3]; - updateNumbers(); - syncSliders(); -} - -function updateNumbers() { - $(".section.customBackgroundFilter .blur .value").html( - parseFloat(filters.blur.value).toFixed(1) - ); - $(".section.customBackgroundFilter .brightness .value").html( - parseFloat(filters.brightness.value).toFixed(1) - ); - $(".section.customBackgroundFilter .saturate .value").html( - parseFloat(filters.saturate.value).toFixed(1) - ); - $(".section.customBackgroundFilter .opacity .value").html( - parseFloat(filters.opacity.value).toFixed(1) - ); -}