luci-base: cbi.js: fade to-be-deleted section when hovering delete button

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 590d1cc74f)
This commit is contained in:
Jo-Philipp Wich 2018-07-23 15:06:26 +02:00
parent 6cf7d11e15
commit 97b3e5773d

View file

@ -627,6 +627,18 @@ function cbi_init() {
s.parentNode.classList.add('cbi-tooltip-container'); 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(); cbi_d_update();
} }