From 5b2485ace3a8a54809b0b68cdc2d53b23e029f0e Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 5 Jul 2021 09:46:58 +0200 Subject: [PATCH] utils: updateColumnWidth: allow overriding tresholdWidth and make that more general Signed-off-by: Thomas Lamprecht --- src/Utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Utils.js b/src/Utils.js index 7f0161e..546cd64 100644 --- a/src/Utils.js +++ b/src/Utils.js @@ -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') { @@ -553,7 +553,8 @@ utilities: { 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) { -- 2.39.2