Skip to content

Instantly share code, notes, and snippets.

@nickstamas
Forked from JoshDoody/gist:174444519da0f8f970f4
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save nickstamas/4c03554729ab86d9e1ba to your computer and use it in GitHub Desktop.

Select an option

Save nickstamas/4c03554729ab86d9e1ba to your computer and use it in GitHub Desktop.
$(function() {
$.each( $(".submission_user_select"), function(key, el) {
$(el).tokenInput("/teams/"+$(el).attr('data-team-id')+"/team_members.json", {
crossDomain: false,
prePopulate: $("#submission_user_id").data("pre"),
hintText: "Type a member name...",
tokenLimit: 1,
propertyToSearch: "full_name",
placeholder: "Type a member name...",
theme: "facebook",
resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch] + "</li>" },
preventDuplicates: true
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment