BattleSim/client/app/js/views/battle_list_view.coffee

15 lines
345 B
CoffeeScript

class @BattleListView extends Backbone.View
template: JST['battle_list']
initialize: (attributes) =>
@battles = []
@render()
refreshList: =>
PokeBattle.primus.send "getBattleList", (battles) =>
@battles = _(battles).sortBy((battle) => battle[3])
@render()
render: =>
@$el.html @template(battles: @battles)