]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
utils: column width handler: drop duplicate
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 07:34:32 +0000 (09:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 07:34:32 +0000 (09:34 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Utils.js

index d033fc54c0d6038852f3c640b05f40e56bc53c3f..7f0161eb9c1c8aa5ea9515de800a14245327119e 100644 (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;