luci-mod-network: fix opacity for device icon tooltips
authorJo-Philipp Wich <jo@mein.io>
Thu, 18 Mar 2021 16:24:09 +0000 (17:24 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 18 Mar 2021 16:28:41 +0000 (17:28 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index 0829a92fdd6fcb25181ccb01a8ea92ea3994c928..0157d2b1269c8189469efbbb792566d848294314 100644 (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') || '?')
+                               ])
                        ]);
                };