Fix JS error when there is no row.update/delete defined

This commit is contained in:
snipe 2017-02-21 15:40:25 -08:00
parent 53ba2bbb4e
commit ebbc2a60c3

View file

@ -120,11 +120,11 @@ $('.snipe-table').bootstrapTable({
var actions = '<nobr>';
if (row.available_actions.update === true) {
if ((row.available_actions) && (row.available_actions.update === true)) {
actions += '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/edit" class="btn btn-sm btn-warning"><i class="fa fa-pencil"></i></a>&nbsp;';
}
if (row.available_actions.delete === true) {
if ((row.available_actions) && (row.available_actions.delete === true)) {
actions += '<a href="{{ url('/') }}/' + destination + '/' + row.id + '" '
+ ' class="btn btn-danger btn-sm delete-asset" '
+ ' data-toggle="modal" '