MCPcopy
hub / github.com/jonthornton/jquery-timepicker / _handleKeyUp

Method _handleKeyUp

src/timepicker/index.js:692–744  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

690 * Time typeahead
691 */
692 _handleKeyUp(e) {
693 if (!this.list || !Timepicker.isVisible(this.list) || this.settings.disableTextInput) {
694 return true;
695 }
696
697 if (e.type === "paste" || e.type === "cut") {
698 const handler = () => {
699 if (this.settings.typeaheadHighlight) {
700 this._setSelected();
701 } else {
702 this.list.hide();
703 }
704 }
705
706 setTimeout(handler, 0);
707 return;
708 }
709
710 switch (e.keyCode) {
711 case 96: // numpad numerals
712 case 97:
713 case 98:
714 case 99:
715 case 100:
716 case 101:
717 case 102:
718 case 103:
719 case 104:
720 case 105:
721 case 48: // numerals
722 case 49:
723 case 50:
724 case 51:
725 case 52:
726 case 53:
727 case 54:
728 case 55:
729 case 56:
730 case 57:
731 case 65: // a
732 case 77: // m
733 case 80: // p
734 case 186: // colon
735 case 8: // backspace
736 case 46: // delete
737 if (this.settings.typeaheadHighlight) {
738 this._setSelected();
739 } else {
740 this.list.hide();
741 }
742 break;
743 }
744 }
745}
746
747// IE9-11 polyfill for CustomEvent

Callers

nothing calls this directly

Calls 2

_setSelectedMethod · 0.95
isVisibleMethod · 0.80

Tested by

no test coverage detected