From 5395a11fb19b26f66c9fbf4e8e2a638ffa3d99b4 Mon Sep 17 00:00:00 2001 From: Anil Kulkarni Date: Mon, 11 Apr 2016 16:05:31 -0700 Subject: [PATCH] Correctly handle "html style" property names When passing in a property such as "background-color", the code should normalize with the camelCase function earlier as CSS.Lists.colors expects the normalized version. --- velocity.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/velocity.js b/velocity.js index c8b59e73..1fe367aa 100644 --- a/velocity.js +++ b/velocity.js @@ -2759,7 +2759,7 @@ return function (global, window, document, undefined) { colorRed, colorGreen, and colorBlue RGB component tweens into the propertiesMap (which Velocity understands) and remove the shorthand property. */ $.each(propertiesMap, function(property, value) { /* Find shorthand color properties that have been passed a hex string. */ - if (RegExp("^" + CSS.Lists.colors.join("$|^") + "$").test(property)) { + if (RegExp("^" + CSS.Lists.colors.join("$|^") + "$").test(CSS.Names.camelCase(property))) { /* Parse the value data for each shorthand. */ var valueData = parsePropertyValue(value, true), endValue = valueData[0], @@ -2784,7 +2784,7 @@ return function (global, window, document, undefined) { dataArray.push(startValueRGB[i]); } - propertiesMap[property + colorComponents[i]] = dataArray; + propertiesMap[CSS.Names.camelCase(property) + colorComponents[i]] = dataArray; } /* Remove the intermediary shorthand property entry now that we've processed it. */ @@ -3883,4 +3883,4 @@ return function (global, window, document, undefined) { /* The CSS spec mandates that the translateX/Y/Z transforms are %-relative to the element itself -- not its parent. Velocity, however, doesn't make this distinction. Thus, converting to or from the % unit with these subproperties -will produce an inaccurate conversion value. The same issue exists with the cx/cy attributes of SVG circles and ellipses. */ \ No newline at end of file +will produce an inaccurate conversion value. The same issue exists with the cx/cy attributes of SVG circles and ellipses. */