Created
March 30, 2018 17:33
-
-
Save ErvalhouS/b1ca52d4b040b6b37e3d4b831fd8bd16 to your computer and use it in GitHub Desktop.
A great way to handle Select2 page transitions within Turbolinks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('turbolinks:before-cache', function(e) { | |
return $('.form-control.select2').each(function() { | |
return $(this).select2('destroy'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment