mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-05 22:55:49 +02:00
Merge pull request #18879 from calixteman/highlight_hover
Don't add the grey outline when hovering a selected highlight
This commit is contained in:
commit
a77bf87c50
@ -734,14 +734,6 @@ class AnnotationEditorLayer {
|
|||||||
this.#uiManager.toggleSelected(editor);
|
this.#uiManager.toggleSelected(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if the editor is selected.
|
|
||||||
* @param {AnnotationEditor} editor
|
|
||||||
*/
|
|
||||||
isSelected(editor) {
|
|
||||||
return this.#uiManager.isSelected(editor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unselect an editor.
|
* Unselect an editor.
|
||||||
* @param {AnnotationEditor} editor
|
* @param {AnnotationEditor} editor
|
||||||
|
|||||||
@ -1109,6 +1109,10 @@ class AnnotationEditor {
|
|||||||
this.#selectOnPointerEvent(event);
|
this.#selectOnPointerEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isSelected() {
|
||||||
|
return this._uiManager.isSelected(this);
|
||||||
|
}
|
||||||
|
|
||||||
#selectOnPointerEvent(event) {
|
#selectOnPointerEvent(event) {
|
||||||
const { isMac } = FeatureTest.platform;
|
const { isMac } = FeatureTest.platform;
|
||||||
if (
|
if (
|
||||||
@ -1123,7 +1127,7 @@ class AnnotationEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#setUpDragSession(event) {
|
#setUpDragSession(event) {
|
||||||
const isSelected = this._uiManager.isSelected(this);
|
const { isSelected } = this;
|
||||||
this._uiManager.setUpDragSession();
|
this._uiManager.setUpDragSession();
|
||||||
|
|
||||||
const ac = new AbortController();
|
const ac = new AbortController();
|
||||||
|
|||||||
@ -596,11 +596,15 @@ class HighlightEditor extends AnnotationEditor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pointerover() {
|
pointerover() {
|
||||||
this.parent.drawLayer.addClass(this.#outlineId, "hovered");
|
if (!this.isSelected) {
|
||||||
|
this.parent.drawLayer.addClass(this.#outlineId, "hovered");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pointerleave() {
|
pointerleave() {
|
||||||
this.parent.drawLayer.removeClass(this.#outlineId, "hovered");
|
if (!this.isSelected) {
|
||||||
|
this.parent.drawLayer.removeClass(this.#outlineId, "hovered");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#keydown(event) {
|
#keydown(event) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user