Skip to content

Instantly share code, notes, and snippets.

@damianoporta
Created May 13, 2015 10:09
Show Gist options
  • Save damianoporta/1a4cdb39c1520bd0d1cf to your computer and use it in GitHub Desktop.
Save damianoporta/1a4cdb39c1520bd0d1cf to your computer and use it in GitHub Desktop.
<script>
$(document).ready(function() {
$(document).on("page:update", function() {
var config = {
'.chosen-select' : {},
'.chosen-select-deselect' : {allow_single_deselect:true},
'.chosen-select-no-single' : {disable_search_threshold:10},
'.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
'.chosen-select-width' : {width:"95%"}
};
for (var selector in config) {
$(selector).chosen(config[selector]);
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment