luci-base: cbi.js: fade to-be-deleted section when hovering delete button
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
875b561875
commit
590d1cc74f
1 changed files with 12 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue