From c78371ff6846071d260e58c883137fea58a028bd Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Sat, 15 Jun 2013 19:21:07 +0200 Subject: [PATCH] Use .detach() to keep jQuery events and data associated with elements .remove() helpfully kills them all. --- src/jquery.uls.regionfilter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jquery.uls.regionfilter.js b/src/jquery.uls.regionfilter.js index 8a62eb3..abc633d 100644 --- a/src/jquery.uls.regionfilter.js +++ b/src/jquery.uls.regionfilter.js @@ -77,7 +77,8 @@ if ( $element && $parent ) { // Avoid reflows while adding new elements to the list - $element.remove(); + // Use .detach() to keep jQuery events and data associated with elements + $element.detach(); } if ( this.cache ) { @@ -121,8 +122,6 @@ } else { $parent.append( $element ); } - // Restore the events jQuery has helpfully removed - this.options.$target.listen(); } if ( this.options.success ) {