Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] Fix empty list actions column #441

Merged
merged 2 commits into from
May 18, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it a value in the scope instead, this cannot change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return this.$scope.listActions().length > 0;
};

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

return DatagridController;
Expand Down