Skip to content

Commit

Permalink
Merge pull request #590 from d-i-t-a/bugfix/pointer-events
Browse files Browse the repository at this point in the history
updated pointer events and pointer
  • Loading branch information
aferditamuriqi authored Oct 20, 2023
2 parents 5577a68 + b31db1c commit 80f28e6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "2.3.16",
"version": "2.3.17",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"license": "Apache-2.0",
Expand Down
40 changes: 37 additions & 3 deletions src/modules/highlight/TextHighlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,18 @@ export class TextHighlighter {
}
}

highlightArea.style.setProperty("pointer-events", "all");
if (
highlight.type === HighlightType.Search ||
highlight.type === HighlightType.ReadAloud ||
highlight.type === HighlightType.LineFocus ||
highlight.type === HighlightType.PageBreak
) {
highlightArea.style.setProperty("pointer-events", "none");
} else {
highlightArea.style.setProperty("pointer-events", "all");
highlightArea.style.setProperty("cursor", "hand");
}

highlightArea.style.position = "absolute";
highlightArea.scale = scale;
highlightArea.rect = {
Expand Down Expand Up @@ -2943,7 +2954,19 @@ export class TextHighlighter {
"style",
`background-color: rgba(${color.red}, ${color.green}, ${color.blue}, ${DEFAULT_BACKGROUND_COLOR_OPACITY}) !important;`
);
highlightAreaLine.style.setProperty("pointer-events", "all");

if (
highlight.type === HighlightType.Search ||
highlight.type === HighlightType.ReadAloud ||
highlight.type === HighlightType.LineFocus ||
highlight.type === HighlightType.PageBreak
) {
highlightAreaLine.style.setProperty("pointer-events", "none");
} else {
highlightAreaLine.style.setProperty("pointer-events", "all");
highlightAreaLine.style.setProperty("cursor", "hand");
}

highlightAreaLine.style.position = "absolute";
highlightAreaLine.scale = scale;
highlightAreaLine.rect = {
Expand Down Expand Up @@ -3195,7 +3218,18 @@ export class TextHighlighter {
}
}

highlightAreaIcon.style.setProperty("pointer-events", "all");
if (
highlight.type === HighlightType.Search ||
highlight.type === HighlightType.ReadAloud ||
highlight.type === HighlightType.LineFocus ||
highlight.type === HighlightType.PageBreak
) {
highlightAreaIcon.style.setProperty("pointer-events", "none");
} else {
highlightAreaIcon.style.setProperty("pointer-events", "all");
highlightAreaIcon.style.setProperty("cursor", "hand");
}

let self = this;
if (
highlight.type !== HighlightType.PageBreak &&
Expand Down

0 comments on commit 80f28e6

Please sign in to comment.