Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (14 sloc) 437 Bytes
@updateDraftList = Reflux.createAction
asyncResult: true
@draftStore = Reflux.createStore
init: ->
@drafts = []
@listenTo( updateDraftList, @onUpdateDrafts )
onUpdateDrafts: ->
request.get "/admin/drafts.json", (err, response) =>
if response.ok
updateDraftList.completed( response.body )
@drafts = response.body
@trigger @drafts
else
updateDraftList.failed(response.error)