From fbaa5ea857ddc3fef430834861014968ca671c14 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 6 Dec 2018 08:35:02 +0300 Subject: [PATCH] label editor: fix changing tree color of edited item --- js/PrefLabelTree.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 220fd9fe8..8de08d30b 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -20,9 +20,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f if (type == 'label') { const label = dojo.doc.createElement('i'); //const fg_color = args.item.fg_color[0]; - const bg_color = args.item.bg_color[0]; + const bg_color = String(args.item.bg_color); label.className = "material-icons icon-label"; + label.id = 'icon-label-' + String(args.item.bare_id); label.innerHTML = "label"; label.setStyle({ color: bg_color, @@ -82,11 +83,10 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f color = bg; } - const e = $("LICID-" + id); + const e = $("icon-label-" + id); if (e) { - if (fg) e.style.color = fg; - if (bg) e.style.backgroundColor = bg; + if (fg) e.style.color = bg; } const query = {