From fa34065e30a9f34322b9640efd22d3e88ac58b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20R=C3=BCberg?= Date: Mon, 30 May 2016 16:09:17 +0200 Subject: [PATCH] Only register one click listener This is the fix for a bug I had on mobile devices, where I needed to register a lot of swipebox instances on a single Page. The swipebox would start to open slower and slower because there were many click listerners on $(document) at the same time. Alternatively if a single click listeners is not wanted, please consider removing the listerner on destroy. --- src/js/jquery.swipebox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/jquery.swipebox.js b/src/js/jquery.swipebox.js index f2fd0155..3269ddf3 100644 --- a/src/js/jquery.swipebox.js +++ b/src/js/jquery.swipebox.js @@ -76,7 +76,7 @@ } else { - $( document ).on( 'click', selector, function( event ) { + $( document ).one( 'click', selector, function( event ) { // console.log( isTouch );