Created
July 18, 2013 18:32
-
-
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]`
This file contains hidden or 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
# 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