Browse Source

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.
Daniel Scalzi 7 năm trước cách đây
mục cha
commit
4196856d31
2 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 1 1
      app/assets/css/launcher.css
  2. 6 0
      app/assets/js/scripts/settings.js

+ 1 - 1
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. */

+ 6 - 0
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',