Skip to content

Commit

Permalink
Fix empty list actions column
Browse files Browse the repository at this point in the history
  • Loading branch information
manuquentin committed May 15, 2015
1 parent e53e6ac commit 1820df3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/javascripts/ng-admin/Crud/list/Datagrid.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{ field.label() }}
</a>
</th>
<th ng-if="listActions()" class="ng-admin-column-actions">
<th ng-if="datagrid.shouldDisplayActions()" class="ng-admin-column-actions">
Actions
</th>
</tr>
Expand All @@ -25,7 +25,7 @@
<td ng-repeat="field in fields() track by $index" ng-class="field.getCssClasses(entry)">
<ma-column field="::field" entry="::entry" entity="::entity"></ma-column>
</td>
<td ng-if="listActions()" class="ng-admin-column-actions">
<td ng-if="datagrid.shouldDisplayActions()" class="ng-admin-column-actions">
<list-actions entry="::entry" entity="::entity" buttons="listActions()"></list-actions>
</td>
</tr>
Expand Down
5 changes: 5 additions & 0 deletions src/javascripts/ng-admin/Crud/list/DatagridController.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ define(function () {
this.$scope.selection = [];
};


DatagridController.prototype.shouldDisplayActions = function () {
return this.$scope.listActions().length > 0;
};

DatagridController.$inject = ['$scope', '$location', '$anchorScroll'];

return DatagridController;
Expand Down

0 comments on commit 1820df3

Please sign in to comment.