(e)
| 1701 | |
| 1702 | |
| 1703 | function _keydownhandler(e) { |
| 1704 | var self = $(this); |
| 1705 | var tp = self[0].timepickerObj; |
| 1706 | var list = tp.list; |
| 1707 | |
| 1708 | if (!list || !Timepicker.isVisible(list)) { |
| 1709 | if (e.keyCode == 40) { |
| 1710 | // show the list! |
| 1711 | methods.show.call(self.get(0)); |
| 1712 | list = tp.list; |
| 1713 | |
| 1714 | if (!tp._hideKeyboard()) { |
| 1715 | self.trigger('focus'); |
| 1716 | } |
| 1717 | } else { |
| 1718 | return true; |
| 1719 | } |
| 1720 | } |
| 1721 | |
| 1722 | switch (e.keyCode) { |
| 1723 | case 13: |
| 1724 | // return |
| 1725 | if (tp._selectValue()) { |
| 1726 | tp._formatValue({ |
| 1727 | type: "change" |
| 1728 | }); |
| 1729 | |
| 1730 | tp.hideMe(); |
| 1731 | } |
| 1732 | |
| 1733 | e.preventDefault(); |
| 1734 | return false; |
| 1735 | |
| 1736 | case 38: |
| 1737 | // up |
| 1738 | var selected = list.find(".ui-timepicker-selected"); |
| 1739 | |
| 1740 | if (!selected.length) { |
| 1741 | list.find("li").each(function (i, obj) { |
| 1742 | if ($(obj).position().top > 0) { |
| 1743 | selected = $(obj); |
| 1744 | return false; |
| 1745 | } |
| 1746 | }); |
| 1747 | selected.addClass("ui-timepicker-selected"); |
| 1748 | } else if (!selected.is(":first-child")) { |
| 1749 | selected.removeClass("ui-timepicker-selected"); |
| 1750 | selected.prev().addClass("ui-timepicker-selected"); |
| 1751 | |
| 1752 | if (selected.prev().position().top < selected.outerHeight()) { |
| 1753 | list.scrollTop(list.scrollTop() - selected.outerHeight()); |
| 1754 | } |
| 1755 | } |
| 1756 | |
| 1757 | return false; |
| 1758 | |
| 1759 | case 40: |
| 1760 | // down |
nothing calls this directly
no test coverage detected