From 4196856d31ef39dbcc125bbd5baf17348dbf06a0 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Thu, 21 Jun 2018 21:04:10 -0400 Subject: [PATCH] Fixed range slider rendering when value is out of range. If the value of a ranged slider is out of range, the slider will snap to either 0% or 100%. Reduced memory label margin to preserve sufficient spacing. --- app/assets/css/launcher.css | 2 +- app/assets/js/scripts/settings.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/css/launcher.css b/app/assets/css/launcher.css index 2fec6a4..b7736de 100644 --- a/app/assets/css/launcher.css +++ b/app/assets/css/launcher.css @@ -1422,7 +1422,7 @@ input:checked + .toggleSwitchSlider:before { /* Label which displays a memory slider's value. */ .settingsMemoryLabel { font-size: 14px; - margin-right: 3%; + margin-right: 2%; } /* Range sliders for min and max memory settings. */ diff --git a/app/assets/js/scripts/settings.js b/app/assets/js/scripts/settings.js index f2a293e..bff08bc 100644 --- a/app/assets/js/scripts/settings.js +++ b/app/assets/js/scripts/settings.js @@ -588,6 +588,12 @@ function updateRangedSlider(element, value, notch){ element.setAttribute('value', value) + if(notch < 0){ + notch = 0 + } else if(notch > 100) { + notch = 100 + } + const event = new MouseEvent('change', { target: element, type: 'change',