Dont show border on parent elements when hovering over child elements

This commit is contained in:
Kovid Goyal 2021-05-21 11:53:59 +05:30
parent b131d9226d
commit c62f144bd7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -43,8 +43,9 @@
for (let elem of document.body.getElementsByTagName('*')) { for (let elem of document.body.getElementsByTagName('*')) {
var style = window.getComputedStyle(elem); var style = window.getComputedStyle(elem);
if (style.display === 'block' || style.display === 'flex-box' || style.display === 'box') { if (style.display === 'block' || style.display === 'flex-box' || style.display === 'box') {
elem.classList.add("calibre_toc_hover"); elem.addEventListener('click', onclick);
elem.onclick = onclick; elem.addEventListener('mouseover', function(ev) { this.classList.add('calibre_toc_hover'); ev.stopPropagation(); });
elem.addEventListener('mouseout', function(ev) { this.classList.remove('calibre_toc_hover'); ev.stopPropagation(); });
} }
} }
} }