Skip to content

Instantly share code, notes, and snippets.

@naneau
Created July 18, 2013 18:32
Show Gist options
  • Save naneau/6031730 to your computer and use it in GitHub Desktop.
Save naneau/6031730 to your computer and use it in GitHub Desktop.
Naive item sort in CoffeeScript/BackBone When the rendered element is stored in `item[@elementKey]`
# Naive Sort
@model.bind 'sort', () => @$el.append item for item in (item[@elementKey].detach() for item in @model.toArray())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment