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:
parent
6cf7d11e15
commit
97b3e5773d
1 changed files with 12 additions and 0 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue