Skip to content

Commit 1c9cb5a

Browse files
committed
All: Stop using jQuery.camelCase, it'll be removed in jQuery 4.0
1 parent 3712776 commit 1c9cb5a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jquery.simulate.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,25 @@
1212
;(function( $, undefined ) {
1313

1414
var rkeyEvent = /^key/,
15+
rdashAlpha = /-([a-z])/g,
1516
rmouseEvent = /^(?:mouse|contextmenu)|click/;
1617

18+
function fcamelCase( _all, letter ) {
19+
return letter.toUpperCase();
20+
}
21+
22+
function camelCase( string ) {
23+
return string.replace( rdashAlpha, fcamelCase );
24+
}
25+
1726
$.fn.simulate = function( type, options ) {
1827
return this.each(function() {
1928
new $.simulate( this, type, options );
2029
});
2130
};
2231

2332
$.simulate = function( elem, type, options ) {
24-
var method = $.camelCase( "simulate-" + type );
33+
var method = camelCase( "simulate-" + type );
2534

2635
this.target = elem;
2736
this.options = options;

0 commit comments

Comments
 (0)