We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3712776 commit 1c9cb5aCopy full SHA for 1c9cb5a
jquery.simulate.js
@@ -12,16 +12,25 @@
12
;(function( $, undefined ) {
13
14
var rkeyEvent = /^key/,
15
+ rdashAlpha = /-([a-z])/g,
16
rmouseEvent = /^(?:mouse|contextmenu)|click/;
17
18
+function fcamelCase( _all, letter ) {
19
+ return letter.toUpperCase();
20
+}
21
+
22
+function camelCase( string ) {
23
+ return string.replace( rdashAlpha, fcamelCase );
24
25
26
$.fn.simulate = function( type, options ) {
27
return this.each(function() {
28
new $.simulate( this, type, options );
29
});
30
};
31
32
$.simulate = function( elem, type, options ) {
- var method = $.camelCase( "simulate-" + type );
33
+ var method = camelCase( "simulate-" + type );
34
35
this.target = elem;
36
this.options = options;
0 commit comments