]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
utils: updateColumnWidth: allow overriding tresholdWidth and make that more general
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 07:46:58 +0000 (09:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jul 2021 07:46:58 +0000 (09:46 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Utils.js

index 7f0161eb9c1c8aa5ea9515de800a14245327119e..546cd64339e77da34b035963fe7b63bcaf243368 100644 (file)
@@ -544,7 +544,7 @@ utilities: {
        });
     },
 
        });
     },
 
-    updateColumnWidth: function(container) {
+    updateColumnWidth: function(container, tresholdWidth) {
        let mode = Ext.state.Manager.get('summarycolumns') || 'auto';
        let factor;
        if (mode !== 'auto') {
        let mode = Ext.state.Manager.get('summarycolumns') || 'auto';
        let factor;
        if (mode !== 'auto') {
@@ -553,7 +553,8 @@ utilities: {
                factor = 1;
            }
        } else {
                factor = 1;
            }
        } else {
-           factor = container.getSize().width < 1600 ? 1 : 2;
+           tresholdWidth = (tresholdWidth || 1400) + 1;
+           factor = Math.ceil(container.getSize().width / tresholdWidth);
        }
 
        if (container.oldFactor === factor) {
        }
 
        if (container.oldFactor === factor) {