From 1aeeda61acdff3a7167a48eb7474875cb81e46db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Tue, 3 Jan 2023 08:36:55 +0100 Subject: [PATCH] jsdialog: use unified naming for treeview icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit unified header and no header treeviews icon shouldn't contain old extension Signed-off-by: Szymon Kłos Change-Id: I0778d49395c084e4ac9adc848b3327529ee37e61 --- browser/src/control/jsdialog/Widget.TreeView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/src/control/jsdialog/Widget.TreeView.js b/browser/src/control/jsdialog/Widget.TreeView.js index e9f0d0c1c..b9f24f873 100644 --- a/browser/src/control/jsdialog/Widget.TreeView.js +++ b/browser/src/control/jsdialog/Widget.TreeView.js @@ -207,7 +207,11 @@ function _headerlistboxEntry(parentContainer, treeViewData, entry, builder) { if (entry.columns[i].collapsed || entry.columns[i].expanded) { var iconId = entry.columns[i].collapsed ? entry.columns[i].collapsed : entry.columns[i].expanded; - iconId = iconId.replaceAll('/', ''); + var newLength = iconId.lastIndexOf('.'); + if (newLength > 0) + iconId = iconId.substr(0, newLength).replaceAll('/', ''); + else + iconId = iconId.replaceAll('/', ''); var icon = L.DomUtil.create('img', 'ui-listview-icon', td); icon.src = builder._createIconURL(iconId, true); } else if (entry.columns[i].text)