Skip to content

Commit

Permalink
Correctly handle "html style" property names
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Anil Kulkarni committed Apr 11, 2016
1 parent 9c9c052 commit 5395a11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions velocity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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. */
Expand Down Expand Up @@ -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. */
will produce an inaccurate conversion value. The same issue exists with the cx/cy attributes of SVG circles and ellipses. */

0 comments on commit 5395a11

Please sign in to comment.