From: Thomas Lamprecht Date: Mon, 5 Jul 2021 07:34:32 +0000 (+0200) Subject: utils: column width handler: drop duplicate X-Git-Url: https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff_plain;h=8b7e349a25165b708bc844159e959c60716aac95 utils: column width handler: drop duplicate Signed-off-by: Thomas Lamprecht --- diff --git a/src/Utils.js b/src/Utils.js index d033fc5..7f0161e 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -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;