MCPcopy
hub / github.com/twitter/typeahead.js / simulateKeyEvent

Function simulateKeyEvent

test/typeahead/input_spec.js:505–520  ·  view source on GitHub ↗
($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;

Callers 1

input_spec.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected