Created
May 18, 2011 14:32
-
-
Save mrjjwright/978688 to your computer and use it in GitHub Desktop.
Example CoffeeKup backbone view
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
| template = CoffeeKup.compile -> | |
| div class: 'section first sources', -> | |
| div id: 'sources-overview', class: 'category', -> | |
| a href: '/sources/overview', -> 'Overview' | |
| div class: 'section', -> | |
| for source in @sources | |
| div id: "sources-#{source.uuid}", class: 'category source', -> | |
| span class: 'searching' | |
| a href: "/sources/#{source.uuid}", -> source.name | |
| RB.Views.Sources = Backbone.View.extend | |
| el: $('#sidebar') | |
| initialize: -> | |
| _.bindAll(this, 'render') | |
| RB.sources.bind('refresh', @render) | |
| render: -> | |
| $(@el).html template context: sources: RB.sources.toJSON() | |
| return this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment