From 97b3e5773d2979438d017c2662e1b02d01839ad2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 23 Jul 2018 15:06:26 +0200 Subject: [PATCH] luci-base: cbi.js: fade to-be-deleted section when hovering delete button Signed-off-by: Jo-Philipp Wich (cherry picked from commit 590d1cc74fe98c2659f250ecdff8801bd9d8fc0d) --- .../luci-base/htdocs/luci-static/resources/cbi.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 9d79b81c19..fcfc506942 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -627,6 +627,18 @@ function cbi_init() { s.parentNode.classList.add('cbi-tooltip-container'); }); + document.querySelectorAll('.cbi-section-remove > input[name^="cbi.rts"]').forEach(function(i) { + var handler = function(ev) { + var bits = this.name.split(/\./), + section = document.getElementById('cbi-' + bits[2] + '-' + bits[3]); + + section.style.opacity = (ev.type === 'mouseover') ? 0.5 : ''; + }; + + i.addEventListener('mouseover', handler); + i.addEventListener('mouseout', handler); + }); + cbi_d_update(); } -- 2.30.2