Created
May 1, 2014 15:38
-
-
Save johno/01eb8c5b5441f54ded41 to your computer and use it in GitHub Desktop.
Integrating chosen for tags with the ability to add (the coffeescript portion).
This file contains 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
window.chosen_select = | |
enable: -> | |
$('.chosen-select').chosen | |
allow_single_deselect: true | |
no_results_text: 'No results found' | |
width: '100%' | |
add: (select, string) -> | |
select.prepend($('<option selected="selected">', { value: string }) | |
.text(string)) | |
.trigger('chosen:updated') | |
$(document).ready -> | |
chosen_select.enable() | |
$(document).on 'page:load', -> | |
chosen_select.enable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment