From 3adb21d0350b40dc9ac5a7f84a93f78317a495c4 Mon Sep 17 00:00:00 2001 From: thyttan <97237430+thyttan@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:15:12 +0200 Subject: [PATCH] Slider: shorten conditional assignment logic Co-authored-by: Rob Pilling --- modules/Slider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Slider.js b/modules/Slider.js index d80a9f910..a617f91f1 100644 --- a/modules/Slider.js +++ b/modules/Slider.js @@ -13,7 +13,7 @@ try { // For making it possiblie to run the test app in the following catch stat // Default configuration for the indicator, modified by parameter `conf`: o.c = Object.assign({ // constants go here. - currLevel:undefined, + currLevel:null, horizontal:false, xStart:R.x2-R.w/4-4, width:R.w/4, @@ -65,7 +65,7 @@ try { // For making it possiblie to run the test app in the following catch stat o.c.r = {x:o.c.xStart, y:o.c.yStart, x2:o.c.xStart+o.c.width, y2:o.c.yStart+o.c.height, w:o.c.width, h:o.c.height}; // Initialize the level - o.v.level = (o.c.currLevel||o.c.currLevel===0)?o.c.currLevel:o.c.steps/2; + o.v.level = o.c.currLevel!==null?o.c.currLevel:o.c.steps/2; // Only add interactivity if wanted. if (o.c.dragableSlider) {