rstacruz / jquery.transit

Super-smooth CSS3 transformations and transitions for jQuery
http://ricostacruz.com/jquery.transit
7.3k stars 864 forks source link

incorrect IE prefix when converted to css property #227

Open flexphperia opened 9 years ago

flexphperia commented 9 years ago

In uncamel function used to convert a camelcase string to a dasherized string there is a bug. When css property is prefixed with IE prefix "ms" this function should convert it like this:

from this: msTransform should be this: -ms-transform now is this: ms-transform

We have:

function uncamel(str) {
  return str.replace(/([A-Z])/g, function(letter) { return '-' + letter.toLowerCase(); });
}

Should be:

function uncamel(str) {
  return str.replace(/([A-Z])/g, function(letter) { return '-' + letter.toLowerCase(); }).replace(/^ms-/,'-ms-');
}