From c4eeee5eda8663a5da03a536201f7cf6795ad478 Mon Sep 17 00:00:00 2001 From: Ben Burgess <88810029+bx80@users.noreply.github.com> Date: Wed, 26 Jul 2023 00:00:38 +1200 Subject: [PATCH] Remove max-width from datatables (#21056) --- plugins/CoreHome/javascripts/dataTable.js | 45 ----------------------- 1 file changed, 45 deletions(-) diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index da30564cadf..5b1fd5fc808 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -417,49 +417,6 @@ $.extend(DataTable.prototype, UIControl.prototype, { return parseInt(totalWidth, 10); } - function setMaxTableWidthIfNeeded (domElem, maxTableWidth) - { - var $domElem = $(domElem); - var dataTableInCard = $domElem.parents('.card').first(); - var parentDataTable = $domElem.parent('.dataTable'); - - if ($domElem.is('.dataTableVizEvolution,.dataTableVizStackedBarEvolution')) { - return; // don't resize evolution charts - } - - dataTableInCard.width(''); - $domElem.width(''); - parentDataTable.width(''); - - var tableWidth = getTableWidth(domElem); - - if (tableWidth <= maxTableWidth && tableWidth > 0) { - return; - } - - if (self.isWidgetized() || self.isDashboard()) { - return; - } - - if (dataTableInCard && dataTableInCard.length) { - // makes sure card has the same width - dataTableInCard.css('max-width', maxTableWidth); - } else { - $domElem.css('max-width', maxTableWidth); - } - - if (parentDataTable && parentDataTable.length) { - // makes sure dataTableWrapper and DataTable has same size => makes sure maxLabelWidth does not get - // applied in getLabelWidth() since they will have the same size. - - if (dataTableInCard.length) { - dataTableInCard.css('max-width', maxTableWidth); - } else { - parentDataTable.css('max-width', maxTableWidth); - } - } - } - function getLabelWidth(domElem, tableWidth, minLabelWidth, maxLabelWidth) { var labelWidth = minLabelWidth; @@ -560,8 +517,6 @@ $.extend(DataTable.prototype, UIControl.prototype, { return labelWidth - paddingLeft - paddingRight; } - setMaxTableWidthIfNeeded(domElem, 1600); - var isTableVisualization = this.param.viewDataTable && typeof this.param.viewDataTable === 'string' && typeof this.param.viewDataTable.indexOf === 'function'