From 61112d880939245e3bd4ae3e64977f447d9e1f70 Mon Sep 17 00:00:00 2001 From: Gabriel JUCHAULT Date: Thu, 12 Dec 2013 02:05:28 +0100 Subject: [PATCH] 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. --- js/foundation/foundation.reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); } }); -- 2.47.2