mirror of https://github.com/apache/cloudstack.git
metrics: fix column/cell visibility and alignment on row additions
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
885ebd2778
commit
c0904171f3
|
|
@ -798,21 +798,25 @@
|
|||
startIndex += parseInt($(this).attr('colspan'));
|
||||
});
|
||||
var endIndex = startIndex + parseInt(prevTh.attr('colspan'));
|
||||
prevTh.closest('table').find('tbody td').filter(function() {
|
||||
var bodySection = prevTh.closest('table').find('tbody td').filter(function() {
|
||||
return $(this).index() >= startIndex && $(this).index() < endIndex;
|
||||
}).toggle();
|
||||
prevTh.closest('table').find('thead tr:last th').filter(function() {
|
||||
});
|
||||
var headSection = prevTh.closest('table').find('thead tr:last th').filter(function() {
|
||||
return $(this).index() >= startIndex && $(this).index() < endIndex;
|
||||
}).toggle();
|
||||
});
|
||||
prevTh.toggle();
|
||||
karet.empty();
|
||||
var karetSpan = $('<span>');
|
||||
karetSpan.css({'font-size': '15px'});
|
||||
if (prevTh.is(':visible')) {
|
||||
karetSpan.html('«').appendTo(karet);
|
||||
headSection.show();
|
||||
bodySection.show();
|
||||
} else {
|
||||
$('<span>').html(trText.substring(0,3) + ' ').appendTo(karet);
|
||||
karetSpan.html('»').appendTo(karet);
|
||||
headSection.hide();
|
||||
bodySection.hide();
|
||||
}
|
||||
$tr.closest('.list-view').find('.no-split').dataTable('refresh');
|
||||
});
|
||||
|
|
@ -1108,6 +1112,7 @@
|
|||
var listViewArgs = $listView.data('view-args');
|
||||
var uiCustom = listViewArgs.uiCustom;
|
||||
var subselect = uiCustom ? listViewArgs.listView.subselect : null;
|
||||
var hasCollapsibleColumn = false;
|
||||
|
||||
if (!(data && data.length)) {
|
||||
$listView.data('end-of-table', true);
|
||||
|
|
@ -1173,6 +1178,7 @@
|
|||
});
|
||||
reducedFields['blank-cell-' + idx] = {blankCell: true};
|
||||
idx += 1;
|
||||
hasCollapsibleColumn = true;
|
||||
} else {
|
||||
reducedFields[key] = this;
|
||||
}
|
||||
|
|
@ -1588,6 +1594,13 @@
|
|||
}
|
||||
});
|
||||
|
||||
// Toggle collapsible column to fix alignment of hidden/shown cells
|
||||
if (hasCollapsibleColumn) {
|
||||
var collapsibleKarets = $tbody.closest('table').find('th.collapsible-column');
|
||||
collapsibleKarets.click();
|
||||
collapsibleKarets.click();
|
||||
}
|
||||
|
||||
return rows;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue