Skip to content

Instantly share code, notes, and snippets.

@mnutt
Created September 20, 2014 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnutt/4eb5f4a63b5bf431e0c1 to your computer and use it in GitHub Desktop.
Save mnutt/4eb5f4a63b5bf431e0c1 to your computer and use it in GitHub Desktop.
TaggedInputComponent = ValidatingInputComponent.extend
didInsertElement: ->
Em.run.schedule "afterRender", @, ->
tags = (@get("value") || "").split(",")
@$('input').select2
tags: tags
tokenSeparators: [","]
maximumSelectionSize: 3
selectOnBlur: true
width: "resolve"
minimumInputLength: 2
dropdownCss:
display: "none"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment