From: Gabriel JUCHAULT Date: Thu, 12 Dec 2013 01:05:28 +0000 (+0100) Subject: Fix escape key when no reveal is shown X-Git-Tag: 5.0.3~71^2~33^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3872%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix escape key when no reveal is shown If you try to press escape key when no reveal modal is shown; an error is thrown. Fixed. --- diff --git a/js/foundation/foundation.reveal.js b/js/foundation/foundation.reveal.js index 4f61b8967..420920932 100644 --- a/js/foundation/foundation.reveal.js +++ b/js/foundation/foundation.reveal.js @@ -106,7 +106,7 @@ $('body').on('keyup.fndtn.reveal', function ( event ) { var open_modal = $('[data-reveal].open'), settings = open_modal.data('reveal-init'); - if ( event.which === 27 && settings.close_on_esc) { // 27 is the keycode for the Escape key + if ( settings && event.which === 27 && settings.close_on_esc) { // 27 is the keycode for the Escape key open_modal.foundation('reveal', 'close'); } });