Skip to content

Commit

Permalink
stopping multiple keyup.fndtn.reveal event firing from a single key p…
Browse files Browse the repository at this point in the history
…ress
  • Loading branch information
btsai committed Jan 15, 2014
1 parent 5f10dd4 commit 01a3523
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/foundation/foundation.reveal.js
Expand Up @@ -66,7 +66,7 @@

$(this.scope)
.off('.reveal');

$(document)
.on('click.fndtn.reveal', this.close_targets(), function (e) {

Expand Down Expand Up @@ -105,7 +105,8 @@
.on('closed.fndtn.reveal', '[data-reveal]', this.close_video);
}

$('body').on('keyup.fndtn.reveal', function ( event ) {
// PATCH #1: fixing multiple keyup event trigger from single key press
$('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {
var open_modal = $('[data-reveal].open'),
settings = open_modal.data('reveal-init');
if ( settings && event.which === 27 && settings.close_on_esc) { // 27 is the keycode for the Escape key
Expand Down

0 comments on commit 01a3523

Please sign in to comment.