mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
List view UI: fix blank actions column
Fixes issue where blank actions column will show if there are header actions, but no standard actions
This commit is contained in:
parent
ff6177d119
commit
e86f81152f
@ -648,7 +648,21 @@
|
||||
}
|
||||
|
||||
// Actions column
|
||||
if (actions && renderActionCol(actions)) {
|
||||
var actionsArray = $.map(actions, function(v, k) {
|
||||
if (k == 'add') {
|
||||
v.isAdd = true;
|
||||
}
|
||||
|
||||
return v;
|
||||
});
|
||||
var headerActionsArray = $.grep(
|
||||
actionsArray,
|
||||
function(action) {
|
||||
return action.isHeader || action.isAdd;
|
||||
}
|
||||
);
|
||||
|
||||
if (actions && renderActionCol(actions) && actionsArray.length != headerActionsArray.length) {
|
||||
$thead.find('tr').append(
|
||||
$('<th></th>')
|
||||
.html(_l('label.actions'))
|
||||
@ -1014,7 +1028,21 @@
|
||||
$tr.data('jsonObj', dataItem);
|
||||
$tr.data('list-view-action-filter', options.actionFilter);
|
||||
|
||||
if (actions && renderActionCol(actions)) {
|
||||
var actionsArray = $.map(actions, function(v, k) {
|
||||
if (k == 'add') {
|
||||
v.isAdd = true;
|
||||
}
|
||||
|
||||
return v;
|
||||
});
|
||||
var headerActionsArray = $.grep(
|
||||
actionsArray,
|
||||
function(action) {
|
||||
return action.isHeader || action.isAdd;
|
||||
}
|
||||
);
|
||||
|
||||
if (actions && renderActionCol(actions) && actionsArray.length != headerActionsArray.length) {
|
||||
var allowedActions = $.map(actions, function(value, key) {
|
||||
return key;
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user