Skip to content

Commit

Permalink
jsdialog: treeview: we no longer need any dummy columns
Browse files Browse the repository at this point in the history
Because we preprocess data to have all the entries with equal number
of the columns already

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Icda50b2c378c1e39b3847bd18e58e35c2c0de015
  • Loading branch information
eszkadev committed Nov 23, 2024
1 parent 65ae09d commit 210607f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions browser/src/control/jsdialog/Widget.TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 210607f

Please sign in to comment.