Landing pull request 383. Relocating jQuery.camelCase to core; Fixes #9368.
More Details: - https://github.com/jquery/jquery/pull/383 - http://bugs.jquery.com/ticket/9368
This commit is contained in:
parent
b8fc9d14a1
commit
408c98fb4b
3 changed files with 29 additions and 10 deletions
14
src/core.js
14
src/core.js
|
@ -44,6 +44,14 @@ var jQuery = function( selector, context ) {
|
|||
rmsie = /(msie) ([\w.]+)/,
|
||||
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
|
||||
|
||||
// Matches dashed string for camelizing
|
||||
rdashAlpha = /-([a-z])/ig,
|
||||
|
||||
// Used by jQuery.camelCase as callback to replace()
|
||||
fcamelCase = function( all, letter ) {
|
||||
return letter.toUpperCase();
|
||||
},
|
||||
|
||||
// Keep a UserAgent string for use with jQuery.browser
|
||||
userAgent = navigator.userAgent,
|
||||
|
||||
|
@ -582,6 +590,12 @@ jQuery.extend({
|
|||
}
|
||||
},
|
||||
|
||||
// Converts a dashed string to camelCased string;
|
||||
// Used by both the css and data modules
|
||||
camelCase: function( string ) {
|
||||
return string.replace( rdashAlpha, fcamelCase );
|
||||
},
|
||||
|
||||
nodeName: function( elem, name ) {
|
||||
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue