Slider: shorten conditional assignment logic
Co-authored-by: Rob Pilling <robpilling@gmail.com>master
parent
40c205c042
commit
3adb21d035
|
|
@ -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`:
|
// Default configuration for the indicator, modified by parameter `conf`:
|
||||||
o.c = Object.assign({ // constants go here.
|
o.c = Object.assign({ // constants go here.
|
||||||
currLevel:undefined,
|
currLevel:null,
|
||||||
horizontal:false,
|
horizontal:false,
|
||||||
xStart:R.x2-R.w/4-4,
|
xStart:R.x2-R.w/4-4,
|
||||||
width:R.w/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};
|
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
|
// 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.
|
// Only add interactivity if wanted.
|
||||||
if (o.c.dragableSlider) {
|
if (o.c.dragableSlider) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue