From dfd499b4d42f9f1911ce671c0d6c52e3be36034d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 18 Mar 2021 17:24:09 +0100 Subject: [PATCH] luci-mod-network: fix opacity for device icon tooltips Signed-off-by: Jo-Philipp Wich (cherry picked from commit bea7b8dc7cd7231d7ec6ab82fcc80dfaec699326) --- .../resources/view/network/interfaces.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index fbc21c538f..b647f30c85 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -1160,13 +1160,17 @@ return view.extend({ o.modalonly = false; o.textvalue = function(section_id) { var dev = getDevice(section_id), - ext = section_id.match(/^dev:/); + ext = section_id.match(/^dev:/), + icon = render_iface(dev); - return E('span', { - 'class': 'ifacebadge', - 'style': ext ? 'opacity:.5' : null - }, [ - render_iface(dev), ' ', dev ? dev.getName() : (uci.get('network', section_id, 'name') || '?') + if (ext) + icon.querySelector('img').style.opacity = '.5'; + + return E('span', { 'class': 'ifacebadge' }, [ + icon, + E('span', { 'style': ext ? 'opacity:.5' : null }, [ + dev ? dev.getName() : (uci.get('network', section_id, 'name') || '?') + ]) ]); }; -- 2.30.2