don't deselect on click, only scroll if not in view

This commit is contained in:
j 2019-02-01 14:27:28 +05:30
commit 9c765bf863
2 changed files with 10 additions and 8 deletions

View file

@ -113,9 +113,7 @@ function getText(book, cfiRange, cb) {
function onHighlightClicked(e) {
console.log("highlight clicked", e.target.dataset.epubcfi);
if(e.target.classList.contains('selected')) {
e.target.classList.remove('selected')
} else {
if(!e.target.classList.contains('selected')) {
document.querySelectorAll('.epubjs-hl.selected').forEach(function(other) {
other.classList.remove('selected')
})