From 210607f5007b93b73006de67c3350742cd10f665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Fri, 22 Nov 2024 12:31:49 +0100 Subject: [PATCH] jsdialog: treeview: we no longer need any dummy columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because we preprocess data to have all the entries with equal number of the columns already Signed-off-by: Szymon Kłos Change-Id: Icda50b2c378c1e39b3847bd18e58e35c2c0de015 --- browser/src/control/jsdialog/Widget.TreeView.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/browser/src/control/jsdialog/Widget.TreeView.ts b/browser/src/control/jsdialog/Widget.TreeView.ts index a8e721d43155..f6bce54f66ee 100644 --- a/browser/src/control/jsdialog/Widget.TreeView.ts +++ b/browser/src/control/jsdialog/Widget.TreeView.ts @@ -353,8 +353,7 @@ class TreeViewControl { parent: HTMLElement, ) { const tr = L.DomUtil.create('div', 'ui-treeview-entry', parent); - let dummyColumns = - this._columns - (entry.columns ? entry.columns.length : 0); + let dummyColumns = 0; if (this._hasState) dummyColumns++; tr.style.gridColumn = '1 / ' + (this._columns + dummyColumns + 1); @@ -479,15 +478,6 @@ class TreeViewControl { ); } - // dummy columns (for missing elements in current row - eg. icon) - let dummyColumns = - this._columns - (entry.columns ? entry.columns.length : 0); - if (this._isRealTree) dummyColumns--; - for (let index = dummyColumns; index > 0; index--) { - td = L.DomUtil.create('div', '', tr); - rowElements.push(td); - } - // regular columns for (const index in entry.columns) { td = L.DomUtil.create('div', '', tr); @@ -1083,9 +1073,7 @@ class TreeViewControl { parent, ); - let dummyColumns = - this._columns - - (entries[index].columns ? entries[index].columns.length : 0); + let dummyColumns = 0; if (this._hasState) dummyColumns++; subGrid.style.gridColumn = '1 / ' + (this._columns + dummyColumns + 1);