diff --git a/js/modal.js b/js/modal.js index 066436b..0ea34a1 100644 --- a/js/modal.js +++ b/js/modal.js @@ -497,7 +497,7 @@ // Keypress handler Ensures you can only TAB to elements within the modal. // Based on the psuedo-code from WAI-ARIA 1.0 Authoring Practices section // 3.3.1 "Trapping Focus". - var modalTabTrapHandler = function (evt) { + modalTabTrapHandler = function (evt) { // We only care about the TAB key. if (evt.which != 9) { return true; @@ -652,7 +652,9 @@ $(window).unbind('resize', modalContentResize); $('body').unbind('focus', modalEventHandler); $('body').unbind('keypress', modalEventHandler); + $('body').unbind( 'keydown', modalTabTrapHandler ); $('.close').unbind('click', modalContentClose); + $('body').unbind('keypress', modalEventEscapeCloseHandler); $(document).trigger('CToolsDetachBehaviors', $('#modalContent')); // jQuery magic loop through the instances and run the animations or removal.