utils: column width handler: drop duplicate

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-07-05 09:34:32 +02:00
parent 76899da698
commit 8b7e349a25

View File

@ -574,6 +574,9 @@ utilities: {
container.updateLayout();
},
// NOTE: depreacated, use updateColumnWidth
updateColumns: container => Proxmox.Utils.updateColumnWidth(container),
dialog_title: function(subject, create, isAdd) {
if (create) {
if (isAdd) {
@ -1111,36 +1114,6 @@ utilities: {
return acme;
},
updateColumns: function(container) {
let mode = Ext.state.Manager.get('summarycolumns') || 'auto';
let factor;
if (mode !== 'auto') {
factor = parseInt(mode, 10);
if (Number.isNaN(factor)) {
factor = 1;
}
} else {
factor = container.getSize().width < 1400 ? 1 : 2;
}
if (container.oldFactor === factor) {
return;
}
let items = container.query('>'); // direct childs
factor = Math.min(factor, items.length);
container.oldFactor = factor;
items.forEach((item) => {
item.columnWidth = 1 / factor;
});
// we have to update the layout twice, since the first layout change
// can trigger the scrollbar which reduces the amount of space left
container.updateLayout();
container.updateLayout();
},
get_health_icon: function(state, circle) {
if (circle === undefined) {
circle = false;