luci-mod-network: fix opacity for device icon tooltips

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2021-03-18 17:24:09 +01:00
parent 14fdce0fcd
commit bea7b8dc7c

View file

@ -1076,13 +1076,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') || '?')
])
]);
};