Ticket #3938: borderColorFix.patch
File borderColorFix.patch, 1.4 KB (added by , 13 years ago) |
---|
-
ui/effects.core.js
117 117 && newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */ 118 118 && (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */ 119 119 && (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */ 120 ) offset[n] = newStyle[n]; 120 ) { 121 if (n == "borderColor") { 122 // replace borderColor with the 4 border directions, if there is not already an entry for that direction 123 var colors = newStyle[n].split(/\\s+/); 124 if (colors.length == 1) colors = [colors[0], colors[0], colors[0], colors[0]]; 125 else if (colors.length == 2) colors = [colors[0], colors[1], colors[0], colors[1]]; 126 else if (colors.length == 3) colors = [colors[0], colors[1], colors[2], colors[1]]; 127 $.each(['borderTopColor','borderRightColor','borderBottomColor','borderLeftColor'], function(i,attr) { 128 if (!offset[attr]) offset[attr]=colors[i]; 129 }); 130 } 131 else { offset[n] = newStyle[n]; } 132 } 121 133 } 122 134 123 135 that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object