Skip to content

Instantly share code, notes, and snippets.

@zah
Created September 15, 2011 09:20
Show Gist options
  • Select an option

  • Save zah/1218886 to your computer and use it in GitHub Desktop.

Select an option

Save zah/1218886 to your computer and use it in GitHub Desktop.
Coffee vs JS
content.html(mapJoin(songs, function(song, index) {
return "<div class=\"row " +
(evenOrOdd(index)) +
"\"><div class=\"checkbox-wrapper\"><input type=\"checkbox\" value=\"1\" rel=\"style1\" class=\"styled " +
checkboxClass +
"\"/></div><div class=\"name\">" +
(clampString(song.name, 30)) +
"</div><div class=\"artist\">" +
(clampString(song.artist, 30)) +
"</div><div class=\"album\">" +
(clampString(song.album, 30)) +
"</div><div class=\"remove\"><div class=\"x-btn\"></div></div></div>";
}));
# Putting all sorted songs in the table content
content.html mapJoin songs, (song, index) ->
'!jade
.row(class="#{evenOrOdd index}")
.checkbox-wrapper
input(type="checkbox", value="1", class="styled #{checkboxClass}", rel="style1")
.name #{clampString song.name, 30}
.artist #{clampString song.artist, 30}
.album #{clampString song.album, 30}
.remove
.x-btn'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment