embla-carousel
Advanced tools
Comparing version 2.3.2 to 2.3.3
@@ -1908,11 +1908,25 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var nodeStyle = node.style; | ||
var state = { | ||
value: 0 | ||
}; | ||
function x(xValue) { | ||
return "translate3d(".concat(xValue, "%,0px,0px)"); | ||
function roundToTwoDecimals(n) { | ||
return Math.round(n * 100) * 0.01; | ||
} | ||
function to(vector) { | ||
nodeStyle.transform = x(vector.get()); | ||
function translateX(n) { | ||
return "translate3d(".concat(n, "%,0px,0px)"); | ||
} | ||
function to(v) { | ||
var target = roundToTwoDecimals(v.get()); | ||
if (state.value !== target) { | ||
state.value = target; // @ts-ignore | ||
getComputedStyle(node).transform; | ||
nodeStyle.transform = translateX(target); | ||
} | ||
} | ||
var self = { | ||
@@ -1919,0 +1933,0 @@ to: to |
{ | ||
"name": "embla-carousel", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"author": "David Cetinkaya", | ||
@@ -5,0 +5,0 @@ "private": false, |
76246
2009