mignaway / EpubReader

Epub / Book Reader Application built with ElectronJS
https://mignaway.github.io/epub-reader-website/
MIT License
61 stars 1 forks source link

Sometimes clicking on icons doens't work #8

Closed mignaway closed 2 years ago

mignaway commented 2 years ago

.book-navbar-popup-open class elements should work like this:

Achievement: script that hides .book-navbar-popup whenever you click on anything but .book-navbar-popup-open

.book-navbar-popup-open have their own script to toggle the correct box:

$('#show-reading-settings').on('click', function(){
$('.book-navbar-popup').hide();
$('#reading-settings').toggle();
})

script to change: bookNavbarHandler.js

$('body').on('click', function (e) {
if (!$(e.target).hasClass('book-navbar-popup-open') && $(event.target).closest($('.book-navbar-popup')).length == 0) {
$('.book-navbar-popup').hide();
}
});
mignaway commented 2 years ago
if (!$(e.target).hasClass('book-navbar-popup-open') && 
     !$(e.target).parents('.book-navbar-popup-open').length && 
     $(e.target).closest($('.book-navbar-popup')).length == 0){
     $('.book-navbar-popup').hide();
}

has fixed the problem, but click event on iframe doesn't work, once fixed the possibility to close popup also with the iframe click event the issue can be closed.