Function
simulateKeyEvent
($node, type, key, withModifier)
Source from the content-addressed store, hash-verified
| 503 | } |
| 504 | |
| 505 | function simulateKeyEvent($node, type, key, withModifier) { |
| 506 | var $e; |
| 507 | |
| 508 | $e = $.Event(type, { |
| 509 | keyCode: key, |
| 510 | altKey: !!withModifier, |
| 511 | ctrlKey: !!withModifier, |
| 512 | metaKey: !!withModifier, |
| 513 | shiftKey: !!withModifier |
| 514 | }); |
| 515 | |
| 516 | spyOn($e, 'preventDefault'); |
| 517 | $node.trigger($e); |
| 518 | |
| 519 | return $e; |
| 520 | } |
| 521 | |
| 522 | function setCursorPosition($input, pos) { |
| 523 | var input = $input[0], range; |
Tested by
no test coverage detected