Created
September 15, 2011 09:20
-
-
Save zah/1218886 to your computer and use it in GitHub Desktop.
Coffee vs JS
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
| 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>"; | |
| })); |
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
| # 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