Skip to content

Commit e86f811

Browse files
committed
List view UI: fix blank actions column
Fixes issue where blank actions column will show if there are header actions, but no standard actions
1 parent ff6177d commit e86f811

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

‎ui/scripts/ui/widgets/listView.js‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,21 @@
648648
}
649649

650650
// Actions column
651-
if (actions && renderActionCol(actions)) {
651+
var actionsArray = $.map(actions, function(v, k) {
652+
if (k == 'add') {
653+
v.isAdd = true;
654+
}
655+
656+
return v;
657+
});
658+
var headerActionsArray = $.grep(
659+
actionsArray,
660+
function(action) {
661+
return action.isHeader || action.isAdd;
662+
}
663+
);
664+
665+
if (actions && renderActionCol(actions) && actionsArray.length != headerActionsArray.length) {
652666
$thead.find('tr').append(
653667
$('<th></th>')
654668
.html(_l('label.actions'))
@@ -1014,7 +1028,21 @@
10141028
$tr.data('jsonObj', dataItem);
10151029
$tr.data('list-view-action-filter', options.actionFilter);
10161030

1017-
if (actions && renderActionCol(actions)) {
1031+
var actionsArray = $.map(actions, function(v, k) {
1032+
if (k == 'add') {
1033+
v.isAdd = true;
1034+
}
1035+
1036+
return v;
1037+
});
1038+
var headerActionsArray = $.grep(
1039+
actionsArray,
1040+
function(action) {
1041+
return action.isHeader || action.isAdd;
1042+
}
1043+
);
1044+
1045+
if (actions && renderActionCol(actions) && actionsArray.length != headerActionsArray.length) {
10181046
var allowedActions = $.map(actions, function(value, key) {
10191047
return key;
10201048
});

0 commit comments

Comments
 (0)