From e63a0596e45d10f2ede9c3b880023aeef5343e80 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 14 Oct 2012 18:46:16 -0400 Subject: [PATCH] tap on background now closes the modal (closes #2) --- js/avgrund.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/avgrund.js b/js/avgrund.js index 68ac7b4..73590ce 100644 --- a/js/avgrund.js +++ b/js/avgrund.js @@ -31,6 +31,7 @@ var Avgrund = (function(){ function activate( state ) { document.addEventListener( 'keyup', onDocumentKeyUp, false ); document.addEventListener( 'click', onDocumentClick, false ); + document.addEventListener( 'touchstart', onDocumentClick, false ); removeClass( popup, currentState ); addClass( popup, 'no-transition' ); @@ -47,6 +48,7 @@ var Avgrund = (function(){ function deactivate() { document.removeEventListener( 'keyup', onDocumentKeyUp, false ); document.removeEventListener( 'click', onDocumentClick, false ); + document.removeEventListener( 'touchstart', onDocumentClick, false ); removeClass( container, 'avgrund-active' ); removeClass( popup, 'avgrund-popup-animate')