|
6 | 6 | (function (global, factory) { |
7 | 7 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : |
8 | 8 | typeof define === 'function' && define.amd ? define(factory) : |
9 | | - (global.ctrly = factory()); |
10 | | -}(this, (function () { 'use strict'; |
| 9 | + (global = global || self, global.ctrly = factory()); |
| 10 | +}(this, function () { 'use strict'; |
11 | 11 |
|
12 | 12 | function activeElement() { |
13 | 13 | try { |
|
549 | 549 | } |
550 | 550 | } |
551 | 551 | var removeControlClick; |
552 | | - var removeControlKeypress; |
| 552 | + var removeControlKeydown; |
553 | 553 | function init() { |
554 | 554 | if (!removeControlClick) { |
555 | 555 | removeControlClick = delegate(document, 'click', controlSelector, function (e, control) { |
|
558 | 558 | toggle(e, control); |
559 | 559 | } |
560 | 560 | }); |
561 | | - removeControlKeypress = delegate(document, 'keypress', controlSelector, function (e, control) { |
| 561 | + removeControlKeydown = delegate(document, 'keydown', controlSelector, function (e, control) { |
562 | 562 | if (keyCode(e) === 13 |
563 | 563 | || keyCode(e) === 32 |
564 | 564 | ) { |
|
607 | 607 | if (fullReset && removeControlClick) { |
608 | 608 | removeControlClick(); |
609 | 609 | removeControlClick = null; |
610 | | - removeControlKeypress(); |
611 | | - removeControlKeypress = null; |
| 610 | + removeControlKeydown(); |
| 611 | + removeControlKeydown = null; |
612 | 612 | } |
613 | 613 | find(controlSelector).forEach(function (control) { |
614 | 614 | if (fullReset) { |
|
647 | 647 |
|
648 | 648 | return ctrly; |
649 | 649 |
|
650 | | -}))); |
| 650 | +})); |
0 commit comments