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)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 27 May 2021 10:19:05 +0000 (12:19 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bea7b8dc7cd7231d7ec6ab82fcc80dfaec699326)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index fbc21c538fb4b310b9d7ff520b9f6ba762b47a7f..b647f30c85265849459d660f19175d69cdc23edc 100644 (file)
@@ -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') || '?')
+                               ])
                        ]);
                };