Files
mozo-backend/app/assets/javascripts/supplier/app/controllers/tables_index_controller.js.coffee
T
2014-11-21 18:06:20 +01:00

16 lines
516 B
CoffeeScript

App.TablesIndexController = Ember.ArrayController.extend
tables: (-> @get('model').sortBy('casted_number')).property('model.@each.number')
actions:
editTable: (table)->
@modal 'edit_table',
model: table
title_path: 'table.edit.modal.title'
ok: ->
table.save()
close: ->
table.rollback()
destroyTable: (table)->
@send 'confirm',
title: t('table.destroy.modal.title', number: table.get('number'))
ok: -> table.destroyRecord()